Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Loops question

How can a make a loop in a macro until A2 = blank or "". Where can I
put it in the code, in the beginning of the code or the end of it?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 253
Default Loops question

HI,

3 possiblitis :
1. Always execute one
Do
......
lopp while cond=true
2.Execute only if
Do while cond=True
.....
loop
3Variable
Do
..some code
'test
if cond=ture then exit do
some code
Loop
Regards
JY

"AVB Over My Head" wrote in message
oups.com...
How can a make a loop in a macro until A2 = blank or "". Where can I
put it in the code, in the beginning of the code or the end of it?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default Loops question

you'll need to start the loop where you want it to start and end it where you
want to end it (obvious statement). i'd use code similar to the following in
your code:

do
do while range("A2")<""
'here's your looped code
'at the end of your code where you want the loop to end
loop
loop until range("A2")=""

make sure you're doing something with range A2 in this loop or else it will
run forever.

hope this helps,
chad


"AVB Over My Head" wrote:

How can a make a loop in a macro until A2 = blank or "". Where can I
put it in the code, in the beginning of the code or the end of it?


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
Loops SaraJane Excel Discussion (Misc queries) 11 May 26th 07 04:47 AM
Loops... Willabo Excel Discussion (Misc queries) 2 June 14th 06 04:08 PM
Loops alecbowman[_2_] Excel Programming 4 June 11th 06 09:26 AM
Loops Hannes Excel Programming 3 December 29th 04 02:33 PM
basic question about loops ksnapp[_47_] Excel Programming 1 April 8th 04 12:07 AM


All times are GMT +1. The time now is 12:26 AM.

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

About Us

"It's about Microsoft Excel"