Macro from drop down list

kelly1

Well-known Member
Joined
May 11, 2003
Messages
525
Is it possible to run a macro from a dropdown list to go to a specific worksheet?

Example
If ‘sheet1’ was selected from the list the macro would go to ‘sheet1’

If ‘sheet3’ was selected from the list the macro would go to ‘sheet3’

I would change the names to employee’s names that would each have their own worksheet.


Thanks for any help


Kelly
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Kelly

Do you mean you just want the sheet activated?

Or do you want to run a macro on the sheet?
 
Upvote 0
yes, i use something similiar;

1. cell link your drop down menu to cell e1
2. use the following code;
If Worksheets("Worksheet1").Range("$E$1") = 1 Then Call Macro 1

then repeat using Macro 2 etc

Obviously the macro must be match the order of the drop down list.
 
Upvote 0
I'ne assigned the dropdown menu to:
MacroChange()

I've got it to work with

Sub Macro1()
'
' Macro1 Macro
'
Sheets("User01").Select
Range("A1").Select
End Sub
Sub Macro2()
'
' Macro2 Macro
'
Sheets("User02").Select
Range("A1").Select
End Sub
Sub Macro3()
'
' Macro3 Macro
'
Sheets("User03").Select
Range("A1").Select
End Sub
Sub Macro4()
'
' Macro3 Macro

'
Sheets("User04").Select
Range("A1").Select
End Sub
Sub Macro5()
'
' Macro3 Macro'
'
Sheets("User05").Select
Range("A1").Select
End Sub
Sub MacroChange()
'
If Worksheets("Sheet1").Range("$E$1") = 2 Then Call Macro1
If Worksheets("Sheet1").Range("$E$1") = 3 Then Call Macro2
If Worksheets("Sheet1").Range("$E$1") = 4 Then Call Macro3
If Worksheets("Sheet1").Range("$E$1") = 5 Then Call Macro4
If Worksheets("Sheet1").Range("$E$1") = 6 Then Call Macro5
'
End Sub



But you can't re select the same user name twice, you have to select a different user the 2nd time or the macro wont run.


Any ideas please how to get round this



Regards


Kelly
 
Upvote 0
have same problem as you but have learnt to live with it. i.e. by selecting another thing on the dropdown before going back to the previous one. yeah its a mission but............
 
Upvote 0

Forum statistics

Threads
1,224,889
Messages
6,181,606
Members
453,055
Latest member
cope7895

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top