Hi folks,
I'm currently working on a user form which populates a worksheet and then prints, I am trying to add a question to the user form in which the user must answer correctly for the sheet to print. This is my current code which does not work
Private Sub CommandButton1_Click()
'populates worksheet'
Range("D5") = TextBox1.Value
Range("G5") = TextBox2.Value
Range("K5") = TextBox4.Value
Range("D7") = ComboBox1.Value
Range("G7") = ComboBox2.Value
Range("K7") = ComboBox3.Value
'Prints if correct revision number is present'
If Range("K8") = TextBox5.Value Then
ActiveSheet.PrintOut Copies:=TextBox3.Value
Else: MsgBox "Incorrect Revision"
End If
Can anyone see the error?
Many thanks in advance
I'm currently working on a user form which populates a worksheet and then prints, I am trying to add a question to the user form in which the user must answer correctly for the sheet to print. This is my current code which does not work
Private Sub CommandButton1_Click()
'populates worksheet'
Range("D5") = TextBox1.Value
Range("G5") = TextBox2.Value
Range("K5") = TextBox4.Value
Range("D7") = ComboBox1.Value
Range("G7") = ComboBox2.Value
Range("K7") = ComboBox3.Value
'Prints if correct revision number is present'
If Range("K8") = TextBox5.Value Then
ActiveSheet.PrintOut Copies:=TextBox3.Value
Else: MsgBox "Incorrect Revision"
End If
Can anyone see the error?
Many thanks in advance