Run Macro from another X number of times

  • Thread starter Thread starter BOHICA
  • Start date Start date
B

BOHICA

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
 
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
 
if isnumeric(ActiveCell.Value) then
for i = 1 to ActiveCell.Value
Application.Run "'Data 10-25-03.xls'!NEWADDLOAD"
Next
End If
 
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!)
 
Back
Top