Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 196
Default For each loop

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default For each loop

Thank you for your response, but I cannot get it to
work. I put in the last closed parenthesis, still no.
Any suggestions?
-----Original Message-----
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,activecell.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.



.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loop kevcar40 Excel Discussion (Misc queries) 1 June 22nd 11 04:02 PM
Loop kevcar40 Excel Discussion (Misc queries) 1 June 21st 11 01:10 PM
Find loop doesn't loop JSnow Excel Discussion (Misc queries) 2 June 24th 09 08:28 PM
HELP!!!! Can't stop a loop (NOT an infinite loop) TBA[_2_] Excel Programming 3 December 14th 03 03:33 PM
loop? Stu[_8_] Excel Programming 3 September 27th 03 05:03 PM


All times are GMT +1. The time now is 11:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"