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

I have sheet named "Tom", "Bill", and "Joe".

I have a useform with a combobox that has the options "Tom, Bill and Joe".
I want a code that will select the appropriate sheet depending on the cmbx
selection.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default sheet select

I assume that you have the combo box in a cell. Here is some code that will
do what you need.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
On Error Resume Next
Sheets(Target.Value).Select
End If
End Sub

It assumes that you combo box is in Cell A1. You can change that by changing:

Target.Address = "$A$1"

To add this code. Right Click on the worksheet tab that contains the combo
box. the last itme on the list is view code. Select View code and then just
paste this code in and you are off and running...

HTH


"scrabtree23" wrote:

I have sheet named "Tom", "Bill", and "Joe".

I have a useform with a combobox that has the options "Tom, Bill and Joe".
I want a code that will select the appropriate sheet depending on the cmbx
selection.

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
Alternate Row Select in Sheet 1 then Paste to Sheet 2 Steevo Excel Worksheet Functions 4 December 5th 08 06:45 PM
How do I select price from sheet.b where sheet.a part no = sheet.b Sonny Excel Worksheet Functions 4 April 4th 06 05:08 PM
Use Sheet CodeNames to Select Sheet in Different Workbook Randy Excel Discussion (Misc queries) 1 June 10th 05 12:17 AM
Macro, select Sheet "Number", NOT Sheet Name DAA Excel Worksheet Functions 4 November 30th 04 05:29 PM
Select Sheet then Select Range Gee[_2_] Excel Programming 3 May 27th 04 10:10 PM


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