Home |
Search |
Today's Posts |
#1
|
|||
|
|||
How to (re)set a range.value to pass -0- to a "double" variable
Using XL 2003
Sub PrintIf() .......... Dim R As Range Dim ThisPageTotal as Double Set R = ActiveSheet.Cells(Rows.count, "P").End(xlUp) ThisPageTotal = R.Value If ThisPageTotal < 0 Then _ ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True .......... End Sub This above code works fine until it is used on a worksheet with no dollar amount in the cell at ActiveSheet.Cells(Rows.count, "P").End(xlUp) When that happens, the code prints even though the cell may be empty. OK R is a range. When I "Watch" the Variables and there is a dollar value: R may equal (i.e.) 411.27 (Range) R.Value will equal 411.27 (Double) ThisPageTotal = 411.27 (Double) How does I set "R" to pass a -0- to R.Value AND to ThisPageTotal? Set R.Value = 0 ?? or Set R = Nothing ?? Dennis |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Reset controls | Excel Discussion (Misc queries) | |||
How to reset Excel 2000 toolbars to "factory defaults"? | Excel Discussion (Misc queries) | |||
How to pass values of a cell? | Excel Discussion (Misc queries) | |||
pass fail | New Users to Excel | |||
How to pass a workshhet name as a parameter into a subroutine ? | Excel Discussion (Misc queries) |