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

I have a macro that I want to automatically repeat. How
and where to I plug in the Do Loop.

Ex. I have text that I want to Cut and Paste on a line,
that procedure needs to run about 10 times. How to I tell
my macro to keep repeating itself?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Do...Loop Macro

Cass,

You would write the code something like

Do Until (some_condition = False)
' your existing code here
Loop

The some_condition depends on your application. This should
return a value of TRUE as long as you want to continue looping.
When some_condition equals FALSE, the loop will terminate and
execution will continue at the first line of code following the
Loop statement.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Cass" wrote in message
...
I have a macro that I want to automatically repeat. How
and where to I plug in the Do Loop.

Ex. I have text that I want to Cut and Paste on a line,
that procedure needs to run about 10 times. How to I tell
my macro to keep repeating itself?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Do...Loop Macro

Hi
have a look at
For next
in the VBA help

--
Regards
Frank Kabel
Frankfurt, Germany

"Cass" schrieb im Newsbeitrag
...
I have a macro that I want to automatically repeat. How
and where to I plug in the Do Loop.

Ex. I have text that I want to Cut and Paste on a line,
that procedure needs to run about 10 times. How to I tell
my macro to keep repeating itself?


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 to run macro each row PST Excel Discussion (Misc queries) 1 May 17th 07 06:36 AM
how can i loop a macro Remote help Excel Discussion (Misc queries) 1 July 21st 05 02:57 AM
Help With loop macro?? pauluk[_28_] Excel Programming 1 April 16th 04 01:58 AM
Using for loop in a macro dipti.agrawal Excel Programming 2 January 16th 04 06:18 PM
Loop macro help. Pete[_13_] Excel Programming 2 November 14th 03 10:32 PM


All times are GMT +1. The time now is 12:23 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"