Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Macro repeats and then stops

I have two columns of data. I have written a macro to operate on the data
from the first column (i.e. copy, paste, move cursor, etc.). I want that
macro to repeat for the data in column 1 as long as there is data in column
2. When a blank cell in column 2 is reached the macro should stop.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Macro repeats and then stops

as ALWAYS, post your code for comments but something along this idea
lr=cells(rows.count,2).end(xlup).row
for i=2 to lr
do your thing
next i

--
Don Guillett
SalesAid Software

"Sabba Efie" wrote in message
...
I have two columns of data. I have written a macro to operate on the data
from the first column (i.e. copy, paste, move cursor, etc.). I want that
macro to repeat for the data in column 1 as long as there is data in
column
2. When a blank cell in column 2 is reached the macro should stop.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,089
Default Macro repeats and then stops

One way:

i = 1
Do While Range("B" & i) < ""
MsgBox Range("A" & i).Value
' Replace the MsgBox line above with a call to your macro
' For example:
' YourMacro
i = i + 1
Loop

Regards

Trevor


"Sabba Efie" wrote in message
...
I have two columns of data. I have written a macro to operate on the data
from the first column (i.e. copy, paste, move cursor, etc.). I want that
macro to repeat for the data in column 1 as long as there is data in
column
2. When a blank cell in column 2 is reached the macro should stop.



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



All times are GMT +1. The time now is 08:42 AM.

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"