ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   MACRO QUESTION (https://www.excelbanter.com/excel-discussion-misc-queries/90779-macro-question.html)

HELP

MACRO QUESTION
 
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?

Bob Phillips

MACRO QUESTION
 
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)

"HELP" wrote in message
...
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?





All times are GMT +1. The time now is 09:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com