Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Programmatically allowing user to select worksheet

I'd like to instruct the user to select a worksheet to work on and then I'll
identify it as WS1 or WS2. How would I do this?

Thanks,
Barb Reinhardt

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Programmatically allowing user to select worksheet

How about something like this. Place a ComboBox (from the control toolbox) on
a sheet and add the following code... You will probably want to clean it up a
bit but it allows the user to select a sheet and you can then capture the
sheet name...

Public wksSelected As Worksheet

Private Sub ComboBox1_Change()
If ComboBox1.Text < "" Then
Set wksSelected = Sheets(ComboBox1.Text)
wksSelected.Select
End If
End Sub

Private Sub ComboBox1_GotFocus()
Dim wks As Worksheet

With ComboBox1
.Clear
For Each wks In Worksheets
If wks.Name < Me.Name Then .AddItem wks.Name
Next wks
End With
End Sub
--
HTH...

Jim Thomlinson


"Barb Reinhardt" wrote:

I'd like to instruct the user to select a worksheet to work on and then I'll
identify it as WS1 or WS2. How would I do this?

Thanks,
Barb Reinhardt

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Programmatically allowing user to select worksheet


Dim rng As Range

Set rng = Application.InputBox("Select a range (any range) on the target
sheet?", Type:=8)
If Not rng Is Nothing Then

Set WS1 = rng.Parent
End If

--
---
HTH

Bob

__________________________________________
UK Cambridge XL Users Conference 29-30 Nov
http://www.exceluserconference.com/UKEUC.html

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Barb Reinhardt" wrote in message
...
I'd like to instruct the user to select a worksheet to work on and then
I'll
identify it as WS1 or WS2. How would I do this?

Thanks,
Barb Reinhardt



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
Locking a worksheet, but allowing user to add rows in a table Ray Carter Excel Worksheet Functions 2 September 24th 08 11:51 PM
Allowing user to locate and select a file and save results in stri ArielZusya Excel Programming 5 November 1st 07 08:28 PM
Allowing user to select a cell in another workbook in VBA Stephen[_23_] Excel Programming 1 September 12th 06 12:02 AM
Allowing the user to specify save location TimN Excel Programming 5 August 16th 06 05:17 PM
Allowing User to save file Jordan Excel Programming 5 April 27th 06 07:24 PM


All times are GMT +1. The time now is 02:54 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"