List Box That Can Run Macros Based on Selection

Fishing4answers

New Member
Joined
Aug 10, 2021
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hello,
I am trying to get a Listbox to run a macro. I have the box open with 6 items. Based on the selection a macro will run for the specific choice.

Example:
If January is selected Sheets("January"). Visible=true
Create a drop down 1-4
If August is selected Sheets("August"). Visible=true

And so on.
Any help would be appreciated.
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Where is the listbox on a userform or on a worksheet? If a worksheet can you post a copy of it using XL2BB?
 
Upvote 0
Proof of concept.xlsm
ABCDEFGHIJK
1Type
2Months123Months
3Januaryxxx
4Februaryx
5Marchxx
6April
7May
8June
9July
10August
11September
12October
13November
14December
15
16
17
18
Landing Page

1628630709633.png

The boxlist isn't showing in the preview but it is in the excel.

To add more context to the example. We received options for January, February, and March. I want those tabs to now be displayed since I selected them. There will be additional prompts in prior tabs to fill out the data on those sheets. The idea is that we can only see what is applicable without manually hiding and showing (the actual worksheet has 30+ options). Once I select March I want to be able to then only show the 2nd option and 3rd.
Let me know if this helps.
 
Upvote 0
Where is the listbox on a userform or on a worksheet? If a worksheet can you post a copy of it using XL2BB?
1628630709633.png


The boxlist isn't showing in the preview but it is in the excel.

To add more context to the example. We received options for January, February, and March. I want those tabs to now be displayed since I selected them. There will be additional prompts in prior tabs to fill out the data on those sheets. The idea is that we can only see what is applicable without manually hiding and showing (the actual worksheet has 30+ options). Once I select March I want to be able to then only show the 2nd option and 3rd.
Let me know if this helps.
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,207
Members
452,618
Latest member
Tam84

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