Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What I am trying to do is to summarize all sheets in the workbook onto
a "summary" tab This summary should have the format of: On Summary Sheet <B1Sheet a's Name <B2Sheet a's First Row <B3Sheet b's Name <B4Sheet b's First Row I am not great at vb style programming. Here is the pseudo style code. Any help makeing this code to become working is appreciated. This is for Excel 97. Sub CreateSummaryOfWorkbooks() Dim wsName As String X = 1 For Each Sheet In Sheets Sheet.Select wsName = Worksheet.Name ' problem setting name into string Cells(A, 1).Select Selection.EntireRow.Copy Worksheets("Summary").Select Cells(B, X) = wsName Cells(B, X + 1).Paste X = X + 2 Next End Sub Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
not tested but try Sub CreateSummaryOfWorkbooks() Dim wsName As String Dim wks as worksheet Dim target_sheet as worksheet Dim X set target_sheet=Worksheets("Summary") X = 1 For Each wks In worksheets wsName = wks.name if lcase(wksname)<"summary" then target_wks.Cells(X,"B").value = wsName target_wks.cells(X+1,"B").value=wks.cells(1,"A").v alue X = X + 2 end if Next End Sub -- Regards Frank Kabel Frankfurt, Germany Johnny wrote: What I am trying to do is to summarize all sheets in the workbook onto a "summary" tab This summary should have the format of: On Summary Sheet <B1Sheet a's Name <B2Sheet a's First Row <B3Sheet b's Name <B4Sheet b's First Row I am not great at vb style programming. Here is the pseudo style code. Any help makeing this code to become working is appreciated. This is for Excel 97. Sub CreateSummaryOfWorkbooks() Dim wsName As String X = 1 For Each Sheet In Sheets Sheet.Select wsName = Worksheet.Name ' problem setting name into string Cells(A, 1).Select Selection.EntireRow.Copy Worksheets("Summary").Select Cells(B, X) = wsName Cells(B, X + 1).Paste X = X + 2 Next End Sub Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I print sheets in Excel without blank sheets after page | New Users to Excel | |||
Multiple Sheets (Need to create 500 individual sheets in one workbook, pulling DATA | Excel Worksheet Functions | |||
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? | Excel Worksheet Functions | |||
In 3 active sheets in wkbk, determine& display the # of sheets that have data | Excel Discussion (Misc queries) | |||
Allocate Files to Sheets and Build a Master Sheet which Summarises All Sheets | Excel Programming |