With the following code... I am using it to populate my spread sheets.. works well except for one issue i have.. It is possible that when the input box pops up.. you don't have to input any data Just press enter and it will work only fields that do get data are the date and time.. How can I make it so that if you don't input infomation (job #, Operator # , etc...) that it will force the user to put in info ? Or it won't input the data at all...?
any help would be good...
thanks
Private Sub CommandButton1_Click()
' Add a new job
Dim LastRow As Object
Set LastRow = Sheets("Sheet1").Range("A65536").End(xlUp)
With LastRow
.Offset(1, 0) = InputBox("Please enter a Job #", "Job #")
.Offset(1, 1) = InputBox("Please enter an Operator #", "Operator #")
.Offset(1, 2) = InputBox("Please enter a Part #", "Part #")
.Offset(1, 4) = Date
.Offset(1, 5) = Time
Unload Me
End With
End Sub
any help would be good...
thanks
Private Sub CommandButton1_Click()
' Add a new job
Dim LastRow As Object
Set LastRow = Sheets("Sheet1").Range("A65536").End(xlUp)
With LastRow
.Offset(1, 0) = InputBox("Please enter a Job #", "Job #")
.Offset(1, 1) = InputBox("Please enter an Operator #", "Operator #")
.Offset(1, 2) = InputBox("Please enter a Part #", "Part #")
.Offset(1, 4) = Date
.Offset(1, 5) = Time
Unload Me
End With
End Sub