Validate value in cell

M

Mike

I have a commandbutton in a worksheet called "Worksheet"
for the user to press to print a related worksheet
called "Summary", only if the value in cell C81
in "Worksheet" is equal to 0.00 OR negative 0.01. When I
run the below code I receive a Type mismatch error in the
first line of the code. Why??

If Worksheets("Worksheet").Cells("C81").Value = 0 Then
'Print Summary Sheet
Sheets("Summary").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1,
Collate:=True
Sheets("Worksheet").Select
'ElseIf Worksheets("Worksheet").Cells("C81").Value = -0.01
Then
'Print Summary Sheet
' Sheets("Summary").Select
' ActiveWindow.SelectedSheets.PrintOut Copies:=1,
Collate:=True
' Sheets("Worksheet").Select
'Else
' MsgBox "Worksheet does not balance.", vbOKOnly +
vbWarning, "ABCInc."
End If
End Sub


TIA
Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top