Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
long if statement
I'm sure there must be a short way of doing this
I only want the code to execute if all the cells in a range are filled. So far I have this. All the cells are on the same row If range("A1")<"" and range("A2")<"" _ and range("A3")<"" etc etc then execute code end if TIA |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
long if statement
LiSa
maybe you could use something like this: Sub test1() If WorksheetFunction.CountA(Range("A1:A3")) = 3 Then MsgBox "execute code" End If End Sub Instead of: Sub test2() If Range("A1") < "" _ And Range("A2") < "" _ And Range("A3") < "" Then MsgBox "execute code" End If End Sub Regards Trevor "LiSa" wrote in message ... I'm sure there must be a short way of doing this I only want the code to execute if all the cells in a range are filled. So far I have this. All the cells are on the same row If range("A1")<"" and range("A2")<"" _ and range("A3")<"" etc etc then execute code end if TIA |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Long If Statement | Excel Worksheet Functions | |||
IF statement too long, need another way | Excel Worksheet Functions | |||
very long statement | Excel Discussion (Misc queries) | |||
IF statement too long | Excel Discussion (Misc queries) | |||
Long IF Statement | Excel Discussion (Misc queries) |