Macro within a macro

  • Thread starter Thread starter a m spock
  • Start date Start date
A

a m spock

,I need to write a simple macro which checks value in a cell then, depending
on value returned, starts macro a or macro b. how do i do it.
 
Dim myCell as range
set mycell = workbooks("somebook.xls").worksheets("sheet999").range("a1")
or something like
set mycell = activesheet.range("a1")

if mycell.value = 8 then
call othermacronamehere
else
call adifferentmacrohere
end if
 
Many Thanks. Works like a charm!

Dave Peterson said:
Dim myCell as range
set mycell = workbooks("somebook.xls").worksheets("sheet999").range("a1")
or something like
set mycell = activesheet.range("a1")

if mycell.value = 8 then
call othermacronamehere
else
call adifferentmacrohere
end if
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top