how to retrict excel from closing while remotely entering data

jiaweilee

New Member
Joined
Mar 26, 2016
Messages
13
I already ask the user to key In ID and the cell will be select automatically. next is how to prevent the excel from closing when data is key in remotely in the selected column?

Code:
Sub Enter_1()
Dim data_1 As String
Dim sCell As Variant
Dim rslt As Integer
Dim x As Integer

Do
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    data_1 = InputBox(Prompt:="Enter Employee No.", Title:="Employee", Default:="Enter Employee No. here")
    
    If data_1 = "" Then
        QuestionToMessageBox = "Exit?"
        YesOrNoAnswerToMessageBox = MsgBox(QuestionToMessageBox, vbYesNo, "No")
    End If
    
    If YesOrNoAnswerToMessageBox = vbNo Then
    
        data_1 = InputBox(Prompt:="Enter Employee No.", Title:="Employee", Default:="Enter Employee No. here")
        
    Exit sub    
    End If
  
        If Not IsNumeric(data_1) Or data_1 = "" Then
            rslt = 0
        Else: rslt = 1
        End If
        
        If rslt = 0 Then
         MsgBox "You can only enter a number in this field"
        
        Else:
            Sheets("Oven After Assay Test").Activate
            For x = 6 To 50
                If Cells(x, 8).Value = "" Then
                    Cells(x, 8).Select
                    cancel = True
                    Exit For
                End If
            Next
        End If
 
    Loop While rslt = 0
    


End Sub
 
I don't believe there is anyway where human intervention makes a deliberate attempt to shut a unit down, whilst its in use. The only logical thing I can think of is they create a sign in cardboard and propped over the keyboard saying the machine is in use
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top