Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Worksheet Selected Names

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Worksheet Selected Names


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Worksheet Selected Names

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
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
using the Excel generic worksheet names instead of user-given names in code Paul Excel Discussion (Misc queries) 5 June 26th 09 08:44 PM
MAKE A LIST OF NAMES FROM REPEATED NAMES IN THE SAME WORKSHEET r.kordahi Excel Discussion (Misc queries) 2 January 3rd 09 08:10 AM
Trying to list tab/worksheet names in a summary worksheet Mich Excel Discussion (Misc queries) 1 February 7th 08 02:07 AM
how do i make a drop down list of selected names no repeatition Mehboob Ellahi Excel Worksheet Functions 2 December 30th 05 04:31 PM
How to link Excel worksheet tab names to dates in each worksheet? Pat Excel Worksheet Functions 9 January 31st 05 07:51 AM


All times are GMT +1. The time now is 07:39 PM.

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

About Us

"It's about Microsoft Excel"