Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Run Macro from another X number of times

okay then...I am looking for a way to make a macro that accesses
another macro as a sub routine according to a number in the selected
cell...

Example:
use active cell

run the following line (X)-1 times, X being the active cell value
Application.Run "'Data 10-25-03.xls'!NEWADDLOAD"

So, if the active cell has a value of 4, then the macro would execute
3 times the !NEWADDLOAD macro.

Okay, anyone have any ideas?

Thanks
-The Roach
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Run Macro from another X number of times


for i = 1 to range("a1").value step 1
Application.Run "'Data 10-25-03.xls'!NEWADDLOAD
next i

or

for i = 1 to activecell.value step 1
Application.Run "'Data 10-25-03.xls'!NEWADDLOAD
next i


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Run Macro from another X number of times

if isnumeric(ActiveCell.Value) then
for i = 1 to ActiveCell.Value
Application.Run "'Data 10-25-03.xls'!NEWADDLOAD"
Next
End If


--
Regards,
Tom Ogilvy


BOHICA wrote in message
m...
okay then...I am looking for a way to make a macro that accesses
another macro as a sub routine according to a number in the selected
cell...

Example:
use active cell

run the following line (X)-1 times, X being the active cell value
Application.Run "'Data 10-25-03.xls'!NEWADDLOAD"

So, if the active cell has a value of 4, then the macro would execute
3 times the !NEWADDLOAD macro.

Okay, anyone have any ideas?

Thanks
-The Roach



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Run Macro from another X number of times

Hey guys! Thanks for the help! Not only is it a dinky little macro,
but it works freaking perfect!!! WOOOOHOOOO! I have been away from
the programming scene for a while too...but I am re-learning fast
thanks to this group. Happy Thanksgiving to all! (For those who do
not believe in Thanksgiving, Happy Dayoff!)
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
Macro to paste x number of times hnyb1 Excel Discussion (Misc queries) 4 June 19th 09 02:07 PM
A macro that counts the number of times a file is opened [email protected] Excel Discussion (Misc queries) 2 December 20th 06 01:53 PM
Loop Macro a variable number of times thesaxonuk Excel Discussion (Misc queries) 11 October 31st 06 06:05 PM
Running a Macro a number of times JWF Excel Discussion (Misc queries) 2 March 14th 06 11:10 AM
Count number of times a specific number is displayed in a cell ran subs Excel Worksheet Functions 1 June 27th 05 05:01 PM


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