Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Trever B
 
Posts: n/a
Default Populate Rows from worksheet Names.

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   Report Post  
Posted to microsoft.public.excel.misc
Norman Jones
 
Posts: n/a
Default Populate Rows from worksheet Names.

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   Report Post  
Posted to microsoft.public.excel.misc
JMB
 
Posts: n/a
Default Populate Rows from worksheet Names.

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Worksheet protection with grouped rows? pmw5 Excel Worksheet Functions 7 July 17th 07 04:49 PM
How do I populate a worksheet name in a formula using a cell ref. Badger Excel Discussion (Misc queries) 1 February 6th 06 09:37 PM
Using worksheet names in formulas WightRob Excel Discussion (Misc queries) 2 August 7th 05 07:17 PM
Inserting Filtered RC cell information into other worksheets Dennis Excel Discussion (Misc queries) 10 July 30th 05 01:54 AM
In a protected worksheet allow users to delete rows Jason Trivett Excel Worksheet Functions 1 July 12th 05 09:50 AM


All times are GMT +1. The time now is 10:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"