Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following code, thanks to Jim Thomlinson, problem is it is only
picking up worksheets, I would like it to also list chartsheets as well. Help need to change code to do this. Private Sub Worksheet_Activate() Dim rngToUpdate As Range Dim wks As Worksheet Set rngToUpdate = Range("F5") Application.ScreenUpdating = False For Each wks In Worksheets rngToUpdate = wks.Name Set rngToUpdate = rngToUpdate.Offset(1, 0) Next wks Application.ScreenUpdating = True Set rngToUpdate = Nothing End Sub Thanks, Blue |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Blue
Change the Dim wks As Worksheet to Dim wks As Object and change For each wks in Worksheets to For each wks in Sheets -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England HIS "Blue" wrote in message . .. I have the following code, thanks to Jim Thomlinson, problem is it is only picking up worksheets, I would like it to also list chartsheets as well. Help need to change code to do this. Private Sub Worksheet_Activate() Dim rngToUpdate As Range Dim wks As Worksheet Set rngToUpdate = Range("F5") Application.ScreenUpdating = False For Each wks In Worksheets rngToUpdate = wks.Name Set rngToUpdate = rngToUpdate.Offset(1, 0) Next wks Application.ScreenUpdating = True Set rngToUpdate = Nothing End Sub Thanks, Blue |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Nick, just what I wanted.
Blue "Nick Hodge" wrote in message ... Blue Change the Dim wks As Worksheet to Dim wks As Object and change For each wks in Worksheets to For each wks in Sheets -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England HIS "Blue" wrote in message . .. I have the following code, thanks to Jim Thomlinson, problem is it is only picking up worksheets, I would like it to also list chartsheets as well. Help need to change code to do this. Private Sub Worksheet_Activate() Dim rngToUpdate As Range Dim wks As Worksheet Set rngToUpdate = Range("F5") Application.ScreenUpdating = False For Each wks In Worksheets rngToUpdate = wks.Name Set rngToUpdate = rngToUpdate.Offset(1, 0) Next wks Application.ScreenUpdating = True Set rngToUpdate = Nothing End Sub Thanks, Blue |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
List of worksheets | New Users to Excel | |||
Efficiently Generate 88 Chartsheets | Excel Worksheet Functions | |||
Get a list of worksheets from a WB | Excel Discussion (Misc queries) | |||
List worksheets | Excel Programming | |||
Exporting chartsheets and breaking links | Excel Programming |