Thread: For each loop
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_4_] Don Guillett[_4_] is offline
external usenet poster
 
Posts: 2,337
Default For each loop

something like where you want to copy the NON empty cell 2 cells to the
right.

x=cells(rows.count,activecell.column)
for each c in
range(cells(2,activecell.column),cells(cells(x,act ivecell.column))
if c<"" then c.offset(0,2).value=c
next

--
Don Guillett
SalesAid Software

"Mark" wrote in message
...
How do I create a "for each" loop on each row to check
if a cell is empty and then copy it to another cell on
same row? I am having trouble refering to a column.