Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How do I use countblank in a macro, I got as follows but it gives me an error
Sub Clear() If CountBlank(ActiveCell.Resize(1, 19)) 0 Then Range("A1").Select Else Range("B1").Select End If End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
CountBlank is not a VB function, it is a worksheet function, so you have to
specify that... If WorksheetFunction.CountBlank(ActiveCell.Resize(1, 19)) 0 Then -- Rick (MVP - Excel) "Alberto Ast" wrote in message ... How do I use countblank in a macro, I got as follows but it gives me an error Sub Clear() If CountBlank(ActiveCell.Resize(1, 19)) 0 Then Range("A1").Select Else Range("B1").Select End If End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Rick... it worked perfect...
"Rick Rothstein" wrote: CountBlank is not a VB function, it is a worksheet function, so you have to specify that... If WorksheetFunction.CountBlank(ActiveCell.Resize(1, 19)) 0 Then -- Rick (MVP - Excel) "Alberto Ast" wrote in message ... How do I use countblank in a macro, I got as follows but it gives me an error Sub Clear() If CountBlank(ActiveCell.Resize(1, 19)) 0 Then Range("A1").Select Else Range("B1").Select End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
countblank with sumproduct? | Excel Worksheet Functions | |||
Countblank | Excel Worksheet Functions | |||
CountBlank with a reset? | Excel Discussion (Misc queries) | |||
Countblank formula | Excel Worksheet Functions | |||
CountBlank in calculation | Excel Programming |