View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Open Sheet, Run Macro, Extract data

That looks like it's just the ticket Tom.............thanks ever so much.
Time for me to leave now, I'll work on it over the weekend...........

Thanks again, I do appreciate your help!
Vaya con Dios,
Chuck, CABGx3



"Tom Ogilvy" wrote:

I assume by macro unique to that sheet, you mean you have 38 separate
macros. Then the problem is just to loop through a list of sheet names and
use a corresponding list of macro names to identify the unique macros.


Dim v, v1, rw as Long, i as Long
Dim sh as Worksheet
v = Array("Sheet1", _
"Sheet5", _
. . .
"Sheet2)
v1 = Array("Macro1", _
"Macro5", _
. . .
"Macro2")

rw = 1
for i =lbound(v) to ubound(v)
set sh = worksheets(v(i))
sh.Activate
Application.Run v1(i)
rw = rw + 1
with worksheets("ReportSheet")
.Cells(rw,1),.Value = sh.Range("B2").Value
.Cells(rw,2).Value = sh.Range("C6").Value
End with
Next

--
Regards,
Tom Ogilvy



"CLR" wrote in message
...
Hi All.............

If someone would be so kind, I have great need. I have a XL97 workbook

with
38 hidden sheets. I would like to open each sheet by name, one by one,

run a
macro unique to that sheet, (avg time = 2 minutes), and then extract the
values in cells B2 and C6 (after the macro has run as the data will

change)
to a "ReportSheet" in columns A and B, then on to the next sheet, etc etc.
Any assistance or direction would be greatly appreciated.

TIA
Vaya con Dios,
Chuck, CABGx3