Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
In a workbook with multiple worksheets, each with a unique name, how would I
create a list of of the worksheets? In addition, I'd like to be able to show totals from each sheet beside the sheet's name. |
#2
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
"wally" wrote:
In a workbook with multiple worksheets, each with a unique name, how would I create a list of of the worksheets? In addition, I'd like to be able to show totals from each sheet beside the sheet's name. In a new sheet, run the sub below to list all sheetnames in A2 down Sub ListSheetNames() Dim wkSht As Worksheet Range("A2").Select For Each wkSht In Worksheets Selection = wkSht.Name ActiveCell.Offset(rowOffset:=1, columnOffset:=0).Activate Next wkSht End Sub (Clear A2 which will contain the sheetname of the new sheet) Then enter the key* cell refs in say, B1 across, eg: E5, E20, K5, K20 etc *It's assumed that all sheets are identically structured, and that you want to retrieve the contents of these key cells from each sheet which contain the "totals", or what-have-you Place in B3: =INDIRECT("'"&$A3&"'!"&B$1) Copy B3 across/fill down to populate -- Max Singapore http://savefile.com/projects/236895 Downloads:17,400 Files:358 Subscribers:55 xdemechanik --- |
#3
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
Thanks, that seems to do the job. Appreciate your help.
"Max" wrote: "wally" wrote: In a workbook with multiple worksheets, each with a unique name, how would I create a list of of the worksheets? In addition, I'd like to be able to show totals from each sheet beside the sheet's name. In a new sheet, run the sub below to list all sheetnames in A2 down Sub ListSheetNames() Dim wkSht As Worksheet Range("A2").Select For Each wkSht In Worksheets Selection = wkSht.Name ActiveCell.Offset(rowOffset:=1, columnOffset:=0).Activate Next wkSht End Sub (Clear A2 which will contain the sheetname of the new sheet) Then enter the key* cell refs in say, B1 across, eg: E5, E20, K5, K20 etc *It's assumed that all sheets are identically structured, and that you want to retrieve the contents of these key cells from each sheet which contain the "totals", or what-have-you Place in B3: =INDIRECT("'"&$A3&"'!"&B$1) Copy B3 across/fill down to populate -- Max Singapore http://savefile.com/projects/236895 Downloads:17,400 Files:358 Subscribers:55 xdemechanik --- |
#4
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
Welcome, glad it helped.
-- Max Singapore http://savefile.com/projects/236895 Downloads:17,400, Files:358, Subscribers:55 xdemechanik --- "wally" wrote in message ... Thanks, that seems to do the job. Appreciate your help. |
#5
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
Probably doesn't matter in this case Max, but selecting and activating slows
thing down a bit. Sub CreateListOfSheetsOnFirstSheet() Dim ws As Worksheet For i = 1 To Worksheets.Count With Worksheets(1) Set ws = Worksheets(i) .Cells(i, 1).Value = ws.Name End With Next i End Sub Gord On Mon, 18 Aug 2008 16:10:16 -0700, Max wrote: "wally" wrote: In a workbook with multiple worksheets, each with a unique name, how would I create a list of of the worksheets? In addition, I'd like to be able to show totals from each sheet beside the sheet's name. In a new sheet, run the sub below to list all sheetnames in A2 down Sub ListSheetNames() Dim wkSht As Worksheet Range("A2").Select For Each wkSht In Worksheets Selection = wkSht.Name ActiveCell.Offset(rowOffset:=1, columnOffset:=0).Activate Next wkSht End Sub (Clear A2 which will contain the sheetname of the new sheet) Then enter the key* cell refs in say, B1 across, eg: E5, E20, K5, K20 etc *It's assumed that all sheets are identically structured, and that you want to retrieve the contents of these key cells from each sheet which contain the "totals", or what-have-you Place in B3: =INDIRECT("'"&$A3&"'!"&B$1) Copy B3 across/fill down to populate |
#6
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
Thanks for the tune-up, Gord !
-- Max Singapore http://savefile.com/projects/236895 Downloads:17,400, Files:358, Subscribers:55 xdemechanik --- "Gord Dibben" <gorddibbATshawDOTca wrote in message ... Probably doesn't matter in this case Max, but selecting and activating slows thing down a bit. Sub CreateListOfSheetsOnFirstSheet() Dim ws As Worksheet For i = 1 To Worksheets.Count With Worksheets(1) Set ws = Worksheets(i) .Cells(i, 1).Value = ws.Name End With Next i End Sub |
#7
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
Gord
Please advise how this macro can 'CreateListOfSheetsOnLastSheet'. Wally "Gord Dibben" wrote: Probably doesn't matter in this case Max, but selecting and activating slows thing down a bit. Sub CreateListOfSheetsOnFirstSheet() Dim ws As Worksheet For i = 1 To Worksheets.Count With Worksheets(1) Set ws = Worksheets(i) .Cells(i, 1).Value = ws.Name End With Next i End Sub Gord On Mon, 18 Aug 2008 16:10:16 -0700, Max wrote: "wally" wrote: In a workbook with multiple worksheets, each with a unique name, how would I create a list of of the worksheets? In addition, I'd like to be able to show totals from each sheet beside the sheet's name. In a new sheet, run the sub below to list all sheetnames in A2 down Sub ListSheetNames() Dim wkSht As Worksheet Range("A2").Select For Each wkSht In Worksheets Selection = wkSht.Name ActiveCell.Offset(rowOffset:=1, columnOffset:=0).Activate Next wkSht End Sub (Clear A2 which will contain the sheetname of the new sheet) Then enter the key* cell refs in say, B1 across, eg: E5, E20, K5, K20 etc *It's assumed that all sheets are identically structured, and that you want to retrieve the contents of these key cells from each sheet which contain the "totals", or what-have-you Place in B3: =INDIRECT("'"&$A3&"'!"&B$1) Copy B3 across/fill down to populate |
#8
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
Sub CreateListOfSheetsOnLastSheet()
Dim ws As Worksheet For i = 1 To Worksheets.Count With Worksheets(Worksheets.Count) Set ws = Worksheets(i) .Cells(i, 1).Value = ws.Name End With Next i End Sub Gord On Sat, 30 Aug 2008 18:24:00 -0700, wally wrote: Gord Please advise how this macro can 'CreateListOfSheetsOnLastSheet'. Wally "Gord Dibben" wrote: Probably doesn't matter in this case Max, but selecting and activating slows thing down a bit. Sub CreateListOfSheetsOnFirstSheet() Dim ws As Worksheet For i = 1 To Worksheets.Count With Worksheets(1) Set ws = Worksheets(i) .Cells(i, 1).Value = ws.Name End With Next i End Sub Gord On Mon, 18 Aug 2008 16:10:16 -0700, Max wrote: "wally" wrote: In a workbook with multiple worksheets, each with a unique name, how would I create a list of of the worksheets? In addition, I'd like to be able to show totals from each sheet beside the sheet's name. In a new sheet, run the sub below to list all sheetnames in A2 down Sub ListSheetNames() Dim wkSht As Worksheet Range("A2").Select For Each wkSht In Worksheets Selection = wkSht.Name ActiveCell.Offset(rowOffset:=1, columnOffset:=0).Activate Next wkSht End Sub (Clear A2 which will contain the sheetname of the new sheet) Then enter the key* cell refs in say, B1 across, eg: E5, E20, K5, K20 etc *It's assumed that all sheets are identically structured, and that you want to retrieve the contents of these key cells from each sheet which contain the "totals", or what-have-you Place in B3: =INDIRECT("'"&$A3&"'!"&B$1) Copy B3 across/fill down to populate |
#9
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
Thanks Gord. Appreciate what you do and the advice you give.
Wally "Gord Dibben" wrote: Sub CreateListOfSheetsOnLastSheet() Dim ws As Worksheet For i = 1 To Worksheets.Count With Worksheets(Worksheets.Count) Set ws = Worksheets(i) .Cells(i, 1).Value = ws.Name End With Next i End Sub Gord On Sat, 30 Aug 2008 18:24:00 -0700, wally wrote: Gord Please advise how this macro can 'CreateListOfSheetsOnLastSheet'. Wally "Gord Dibben" wrote: Probably doesn't matter in this case Max, but selecting and activating slows thing down a bit. Sub CreateListOfSheetsOnFirstSheet() Dim ws As Worksheet For i = 1 To Worksheets.Count With Worksheets(1) Set ws = Worksheets(i) .Cells(i, 1).Value = ws.Name End With Next i End Sub Gord On Mon, 18 Aug 2008 16:10:16 -0700, Max wrote: "wally" wrote: In a workbook with multiple worksheets, each with a unique name, how would I create a list of of the worksheets? In addition, I'd like to be able to show totals from each sheet beside the sheet's name. In a new sheet, run the sub below to list all sheetnames in A2 down Sub ListSheetNames() Dim wkSht As Worksheet Range("A2").Select For Each wkSht In Worksheets Selection = wkSht.Name ActiveCell.Offset(rowOffset:=1, columnOffset:=0).Activate Next wkSht End Sub (Clear A2 which will contain the sheetname of the new sheet) Then enter the key* cell refs in say, B1 across, eg: E5, E20, K5, K20 etc *It's assumed that all sheets are identically structured, and that you want to retrieve the contents of these key cells from each sheet which contain the "totals", or what-have-you Place in B3: =INDIRECT("'"&$A3&"'!"&B$1) Copy B3 across/fill down to populate |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Get a list of worksheets from a WB | Excel Discussion (Misc queries) | |||
how do i list the name off all my worksheets on a sheet | Excel Worksheet Functions | |||
how do i list the names of all my worksheets | Excel Discussion (Misc queries) | |||
Create list of worksheets | Excel Discussion (Misc queries) | |||
Define list of worksheets | Excel Worksheet Functions |