Macro executing (copy data) from at sett of sheets in the workbook

  • Thread starter Thread starter Snoopy
  • Start date Start date
S

Snoopy

Hey guys
My workbook [REPORT.XLSM] contains a number of sheets;
Rev01 ..Rev02..Rev03... and so on.
The workbook will expand with new revision sheet RevN+1 occasionally.
I want to copy a range of data (same range in every single sheet) in
all revisions (sheets beginning with "Rev"), and paste the data (only
values) into one new sheet called "Total".
My workbook contains also sheets with other names - not beginning
wirth "Rev"

What kind of macro-loop program will do the job moving from one sheet
to the next beginning with"Rev" and stop after the last one.

Best regards
Snoopy
 
Should get you started

Sub foreacREVsheet()
For i = 1 To Sheets.Count
If LCase(Left(Sheets(i).Name, 3)) = "rev" Then
MsgBox Sheets(i).Range("a1")
End If
Next i
End Sub
 
Should get you started

Sub foreacREVsheet()
For i = 1 To Sheets.Count
If LCase(Left(Sheets(i).Name, 3)) = "rev" Then
MsgBox Sheets(i).Range("a1")
End If
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software



Hey guys
My workbook [REPORT.XLSM] contains a number of sheets;
Rev01 ..Rev02..Rev03... and so on.
The workbook will expand with new revision sheet RevN+1 occasionally.
I want to copy a range of data (same range in every single sheet)  in
all revisions (sheets beginning with "Rev"), and paste the data (only
values) into one new sheet called "Total".
My workbook contains also sheets with other names - not beginning
wirth "Rev"
What kind of macro-loop program will do the job moving from one sheet
to the next beginning with"Rev" and stop after the last one.
Best regards
Snoopy– Skjul sitert tekst –

– Vis sitert tekst –

Thanks Don ! :)
Magnificent!
Regards Snoopy
 
As always, post your final for the archives


--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
Should get you started

Sub foreacREVsheet()
For i = 1 To Sheets.Count
If LCase(Left(Sheets(i).Name, 3)) = "rev" Then
MsgBox Sheets(i).Range("a1")
End If
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software



Hey guys
My workbook [REPORT.XLSM] contains a number of sheets;
Rev01 ..Rev02..Rev03... and so on.
The workbook will expand with new revision sheet RevN+1 occasionally.
I want to copy a range of data (same range in every single sheet) in
all revisions (sheets beginning with "Rev"), and paste the data (only
values) into one new sheet called "Total".
My workbook contains also sheets with other names - not beginning
wirth "Rev"
What kind of macro-loop program will do the job moving from one sheet
to the next beginning with"Rev" and stop after the last one.
Best regards
Snoopy– Skjul sitert tekst –

– Vis sitert tekst –

Thanks Don ! :)
Magnificent!
Regards Snoopy
 
Back
Top