Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
how does the for each cell in range synax work? I have the
following For Each Cell In Range("I3:I9") If Cell.Value = "" Then 'code Next cell which is saying that cell is empty? thanks so much |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It loops through the cells in the specified range one at a time and performs
the code contained within the loop structure against each cell. -- Regards, Tom Ogilvy "David McNally" wrote in message ... how does the for each cell in range synax work? I have the following For Each Cell In Range("I3:I9") If Cell.Value = "" Then 'code Next cell which is saying that cell is empty? thanks so much |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
David,
It takes each cell ion the specified range one at a time and executes the code between the For and the next upon that cell. So first time through, cell will refer to I3, 2nd it will refer to I4, etc. Don't forget your End If. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "David McNally" wrote in message ... how does the for each cell in range synax work? I have the following For Each Cell In Range("I3:I9") If Cell.Value = "" Then 'code Next cell which is saying that cell is empty? thanks so much |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
And it's not really testing for emptiness.
The cell could be empty or it could even contain a giant formula that evaluates to "". =if(a3=7,"",sum(x9:x22)) When a3 = 7, the .value = "". (and a single quote (') would qualify, too.) If you really want empty: if isempty(cell) then David McNally wrote: how does the for each cell in range synax work? I have the following For Each Cell In Range("I3:I9") If Cell.Value = "" Then 'code Next cell which is saying that cell is empty? thanks so much -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Syntax Error In Date | Excel Discussion (Misc queries) | |||
Syntax error | Excel Discussion (Misc queries) | |||
syntax error - help | Excel Discussion (Misc queries) | |||
Syntax Error Runtime Error '424' Object Required | Excel Programming | |||
Where is my syntax error? | Excel Programming |