View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default call macro X by cell value

dim iCtr as long
with activesheet
if isnumeric(.range("s6").value) then
for ictr = 1 to .range("s6").value
call addMC
next ictr
end if
....and more stuff like that....

end with

cyote101 wrote:

First off, this is my first post on this site and i'm excited. I've used
another site for years and recently i thought of looking at other sites-
and talk about a sign or something; after registering the first topic i
saw was the exact topic i was working on! WOW --- I think i've come to
the right place!!!!!!!!!!

so here we go

how would i adapt this code
================================================== ==========
If [s6].Value = 1 Then Call addMC
If [r6].Value = 1 Then Call addJar
If [q6].Value = 1 Then Call add2oz
If [p6].Value = 1 Then Call add8oz
If [o6].Value = 1 Then Call add18oz
If [n6].Value = 1 Then Call add32oz
================================================== =========

so that the macros that are called are run as many times as the value
in their respective cells.

Example: for the first line "If [s6].Value = 1 Then Call addMC" if cell
S6 = 12 then the Macro AddMC will be run 12 times and if cell S6 = 2
then the macro would only me run twice or even if S6 = 0 then the macro
would not be run. I think i've made my point. As you can see there is
more then 2 or so seperate macros their respective cells to run every
time this sub is run. Thanks
Edit/Delete Message

--
cyote101
------------------------------------------------------------------------
cyote101's Profile: http://www.excelforum.com/member.php...o&userid=36145
View this thread: http://www.excelforum.com/showthread...hreadid=559211


--

Dave Peterson