Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
xl 2007 how to validate that cell 1 invalid if cell 2 not blank | Excel Discussion (Misc queries) | |||
how do i validate a cell that has a formula | Excel Discussion (Misc queries) | |||
Validate entry based on another cell value | Excel Discussion (Misc queries) | |||
Can I validate a cell only if a certain condition is met? | Excel Discussion (Misc queries) | |||
How do I validate data from another validation cell? | Excel Worksheet Functions |