Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 5
Default Use text from a cell reference in vba code.

I have a combobox on the first sheet of a workbook. I’m using it to jump to selected pages as there is close to 100 sheets. All selections in the combobox dropdown menu, except one, are sheet names so that part of the vba code is simple.
I’ve used

Code:
Private Sub ComboBox1_Change()

If ComboBox1.Value = "Statistics" Then
Sheets("Statistics").Select
End If
and so on . . . . .

The exception in the dropdown menu is called ‘Current Day’. Each sheet has a unique date. I want to be able to jump to the sheet associated with the current day.
I’m using the ‘vlookup’ function followed by ‘Today()’ to give me the sheet name relating to the current date in cell ‘Sheet 1!$AH$130’.
The combobox linked cell is ‘Sheet1!$AE$128’

Could someone please give me a few pointers, as I am unsure of where to go from here.
Thanks.
  #2   Report Post  
Junior Member
 
Posts: 19
Default

Quote:
Originally Posted by JackyJ View Post
I have a combobox on the first sheet of a workbook. I’m using it to jump to selected pages as there is close to 100 sheets. All selections in the combobox dropdown menu, except one, are sheet names so that part of the vba code is simple.
I’ve used

Code:
Private Sub ComboBox1_Change()

If ComboBox1.Value = "Statistics" Then
Sheets("Statistics").Select
End If
and so on . . . . .

The exception in the dropdown menu is called ‘Current Day’. Each sheet has a unique date. I want to be able to jump to the sheet associated with the current day.
I’m using the ‘vlookup’ function followed by ‘Today()’ to give me the sheet name relating to the current date in cell ‘Sheet 1!$AH$130’.
The combobox linked cell is ‘Sheet1!$AE$128’

Could someone please give me a few pointers, as I am unsure of where to go from here.
Thanks.
Hi,

Probably easier to use an exclusion for the values that are NOT Sheet Names.

Then replace your sheet finder code with

Sheets(ComboBox1.value).select

or similar.

David
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
VBA code for find function (reference cell value) emil Excel Worksheet Functions 0 May 5th 09 01:57 AM
vb code for renaming a work sheet with a cell reference John Britto Excel Discussion (Misc queries) 3 September 17th 06 07:12 PM
What is the Chr() code for Alt+Enter in a cell when entering text? Dennis Excel Discussion (Misc queries) 2 July 20th 06 11:49 PM
Code to get text from part of a cell Keenman Excel Worksheet Functions 3 April 27th 06 04:41 AM
How can I reference data or text within a text box to a cell in Ex BB Excel Discussion (Misc queries) 2 January 25th 05 07:55 PM


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