Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I would like to get the list of names of worksheets which are selected (marked with the mouse). e.g. I have 3 work sheets: Table1 Table2 Table3 I select two of them Table1 and Table2. I am looking for the code which gives me only this two names!! To get all available worksheet names the following code can be used: For Each ws In Worksheets MsgBox ws.Name Next ws Thank you for help. Juraj. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Juraj, try something like: Sub ShowSelWorksheets() Dim sh As Object Dim s As String For Each sh In ActiveWindow.SelectedSheets If TypeName(sh) = "Worksheet" Then s = s & sh.Name & vbNewLine End If Next MsgBox s End Sub keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Juraj" wrote: Hi, I would like to get the list of names of worksheets which are selected (marked with the mouse). e.g. I have 3 work sheets: Table1 Table2 Table3 I select two of them Table1 and Table2. I am looking for the code which gives me only this two names!! To get all available worksheet names the following code can be used: For Each ws In Worksheets MsgBox ws.Name Next ws Thank you for help. Juraj. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks a lot. It works very nice.
Juraj. -----Original Message----- Juraj, try something like: Sub ShowSelWorksheets() Dim sh As Object Dim s As String For Each sh In ActiveWindow.SelectedSheets If TypeName(sh) = "Worksheet" Then s = s & sh.Name & vbNewLine End If Next MsgBox s End Sub keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Juraj" wrote: Hi, I would like to get the list of names of worksheets which are selected (marked with the mouse). e.g. I have 3 work sheets: Table1 Table2 Table3 I select two of them Table1 and Table2. I am looking for the code which gives me only this two names!! To get all available worksheet names the following code can be used: For Each ws In Worksheets MsgBox ws.Name Next ws Thank you for help. Juraj. . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
using the Excel generic worksheet names instead of user-given names in code | Excel Discussion (Misc queries) | |||
MAKE A LIST OF NAMES FROM REPEATED NAMES IN THE SAME WORKSHEET | Excel Discussion (Misc queries) | |||
Trying to list tab/worksheet names in a summary worksheet | Excel Discussion (Misc queries) | |||
how do i make a drop down list of selected names no repeatition | Excel Worksheet Functions | |||
How to link Excel worksheet tab names to dates in each worksheet? | Excel Worksheet Functions |