Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Validate value in cell

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
xl 2007 how to validate that cell 1 invalid if cell 2 not blank declaire9 Excel Discussion (Misc queries) 0 April 13th 10 06:57 PM
how do i validate a cell that has a formula wAYNE Excel Discussion (Misc queries) 4 March 1st 10 07:13 PM
Validate entry based on another cell value Dearoledad Excel Discussion (Misc queries) 3 May 15th 09 10:47 PM
Can I validate a cell only if a certain condition is met? Anita Excel Discussion (Misc queries) 2 July 11th 07 06:34 PM
How do I validate data from another validation cell? Bo Excel Worksheet Functions 20 May 13th 05 11:10 PM


All times are GMT +1. The time now is 07:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"