Hopefully somebody can help/guide me in the right place with two of my Macros..
Firstly I have a check to ensure a cell has valid data. So far it only checks if its zero. I need this to also check if its blank or = ""
The next one is used to generate a popup box where the user will input their name.
I'm trying to make this so if they don't input a name or press the 'Cancel' button then the Macro's will end however it seems to be continuing!
Thanks for the help!
Firstly I have a check to ensure a cell has valid data. So far it only checks if its zero. I need this to also check if its blank or = ""
Code:
Sub Start() If ActiveSheet.Range("E3").Value = "0" Then
MsgBox ("Cell E3 cannot be blank")
Exit Sub
End If
Call Finish
End Sub
The next one is used to generate a popup box where the user will input their name.
I'm trying to make this so if they don't input a name or press the 'Cancel' button then the Macro's will end however it seems to be continuing!
Code:
Sub CopyData()Application.ScreenUpdating = False
'Firstly select the LOG sheet
Sheets("Log").Select
'Then unlock
Sheets("Log").Unprotect Password:="secret"
Application.ScreenUpdating = False
Dim response As String
response = InputBox("Please enter your name.", "Enter your full name")
If response = "" Then MsgBox ("Printing cancelled, you must enter your name")
Exit Sub
Sheets("Log").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0) = response
Application.ScreenUpdating = True
Call LogEntry
End Sub
Thanks for the help!