Using Shapes as Toggle Buttons

CodeNotDoI

New Member
Joined
Feb 12, 2019
Messages
9
This is originally asked on Excelforum.com here is the link: https://www.excelforum.com/excel-programming-vba-macros/1262270-using-shapes-as-option-buttons.html

The goal is to have about 20 shapes that are tied to each other, where if you select one "On" you can choose which shapes are automatically turned "Off". I don't see anywhere to attach files, but there is an example file on Excelforum link posted by the moderator named Button Attempt copy. This has a sheet of toggle buttons (how I need the shapes to function) and a sheet of shapes with Boolean values. This works with toggle buttons using the code in the example file (it's also the code in the OP), but I need shapes. I realized that if any toggles are hidden and you sort they get distorted. I think using shapes are my only option for this and I haven't been able to make any progress with them.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
I haven't had much time to spend on this still. I've added a fourth shape (red columns) and reversed the states, so that only one color shows at one time. This is how the main report will be used, but in certain instances I may want two sections to show. This is almost everything I need, but I also need to have more than one column to be able to show. Example: the first 3 shapes stay the same (act as they do now), but when you click shape4, both Red and Blue sections show (the columns tied to shape4 and shape3).

I'm thinking instead of having only one Deactivate Sub and one Hide Sub for everything, I can create numerous subs based on your code structure, but I am having problems visualizing how to do that. I need to spend more time on it to be sure if I can/cannot figure it out, but I also won't be angry if you figure it out for me haha. Really thank you for all the help you've already provided. Is there a way to give you Rep (similar to excelforumn.com)? Or some other rating?


https://www.dropbox.com/s/l6l0a57tfd8c2fy/shapes toggle v2 - Red Added.xlsm?dl=0
 
Upvote 0
To add to my above statement, the goal isn't neccesarily to get the shape3 and shape4 columns to show (because I could just change the columns for Case 4 to "R:AC"). It would be more like get get shape1 and shape4 (columns B:G and AA:AC) to show. Or if I had a shape5 that hides rows 13-15 that I wanted to show with shape4 columns, have the case for shape4 unhide columns AA:AC and rows 13-15. I'm just trying to be specific in case you do look into this.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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