Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
Thanks in advance. Have a work sheet called summary. In col B starting at row 11 I want to populate it with the names of worksheets within the current file. (Excluding Summary). The trick is I dont know how many worksheets there are. Thanks Trev |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Trev,
In col B starting at row 11 I want to populate it with the names of worksheets within the current file. (Excluding Summary). The trick is I dont know how many worksheets there are. Try: '============= Public Sub Tester() Dim SH As Object Dim i As Long For Each SH In ThisWorkbook.Sheets With SH If UCase(.Name) < "SUMMARY" Then i = i + 1 Sheets("Summary").Range("B11")(i).Value = .Name End If End With Next SH End Sub '<<============= --- Regards, Norman |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You could use a macro to accomplish that.
Sub test() Dim WkSht As Worksheet Dim Count As Long Dim rngTarget As Range Set rngTarget = Worksheets("Summary").Range("B11") For Each WkSht In Worksheets If Not WkSht Is rngTarget.Parent Then Count = Count + 1 rngTarget(Count, 1).Value = WkSht.Name End If Next WkSht End Sub "Trever B" wrote: Hi, Thanks in advance. Have a work sheet called summary. In col B starting at row 11 I want to populate it with the names of worksheets within the current file. (Excluding Summary). The trick is I dont know how many worksheets there are. Thanks Trev |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Worksheet protection with grouped rows? | Excel Worksheet Functions | |||
How do I populate a worksheet name in a formula using a cell ref. | Excel Discussion (Misc queries) | |||
Using worksheet names in formulas | Excel Discussion (Misc queries) | |||
Inserting Filtered RC cell information into other worksheets | Excel Discussion (Misc queries) | |||
In a protected worksheet allow users to delete rows | Excel Worksheet Functions |