Hi all,
Bit of a beginner so please ignora my stupidity
I have asigned a macro to an autoshape (just to create a button) to print to a virtual printer. which works fine but i'm trying to ensure users fill in certain forms before it lets them go ahead. This is the code I have so far
Sub macro1()
If TextBox28.Text = "" Then
MsgBox "Please enter a Date before continuing", vbInformation, "Alert"
Else
If TextBox2.Text = "" Then
MsgBox "Please choose AM or PM before continuing", vbInformation, "Alert"
Else
If TextBox13.Text = "" Then
MsgBox "Please enter the 'Anaesthetist Name/Initial' field before continuing", vbInformation, "Alert"
Else
Range("I32").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
MsgBox "Your form has been submitted", vbInformation, "Confirmation"
End If
End If
End If
End Sub
I keep getting a Run-Time error '424': Object Required
Any help would be appreciated
Thanks
Mark
Bit of a beginner so please ignora my stupidity
I have asigned a macro to an autoshape (just to create a button) to print to a virtual printer. which works fine but i'm trying to ensure users fill in certain forms before it lets them go ahead. This is the code I have so far
Sub macro1()
If TextBox28.Text = "" Then
MsgBox "Please enter a Date before continuing", vbInformation, "Alert"
Else
If TextBox2.Text = "" Then
MsgBox "Please choose AM or PM before continuing", vbInformation, "Alert"
Else
If TextBox13.Text = "" Then
MsgBox "Please enter the 'Anaesthetist Name/Initial' field before continuing", vbInformation, "Alert"
Else
Range("I32").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
MsgBox "Your form has been submitted", vbInformation, "Confirmation"
End If
End If
End If
End Sub
I keep getting a Run-Time error '424': Object Required
Any help would be appreciated
Thanks
Mark