MACRO QUESTION

G

Guest

I have a situation in which a file is sent with many tabs. Every tab has the
same information just different part numbers ex. So I would like to create a
macro that would enable me to extract the data from each tab and input into a
summary tab which the Macro would include. But if I record a macro the tab
names and the number of tabs change with each file. Any suggestions?
 
B

Bob Phillips

On Error Resume Next
Set sh = Worksheets("Summary")
On Error Goto 0
If sh Is N othing Then
Worksheets.Add.Name = "Summary
End If
Worksheets("Summary").Cells.ClearContents

For Each sh In ActiveWorkbook.Worksheets
If sh.Name <> "Summary" Then
i=i+1
Worksheets("Summary").Cells(i,"A").Value = sh.Name
End If
Next sh

--
HTH

Bob Phillips

(replace somewhere in email address with googlemail if mailing direct)
 

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

Top