Sari
05-02-2017, 02:28 AM
Hi all,
I would like to setup some toggle buttons. In my document I have one main-sheet (dashboard) and 29 sub-sheets. On all 29 worksheets I need one toggle button which changes the embedded picture if the value is true or false.
To make sure I don't create an Excel file which has an enourmous size, I would like to insert the 2 pictures on the dashboard and refer from each worksheet toggle button on it.
Unfortunately it only works if I insert the pictures on the same sheet where the toggle button is and this would mean that I need to add 58 pictures to the Excel file.
My file is now almost 6MB, so I need to take care that I won't get too big.
This is the code which works if I add it to every worksheet:
If ToggleButton1.Value = True Then
ToggleButton1.Picture = Image6.Picture
Worksheets("Dashboard").Shapes("Rounded Rectangle 7").TextFrame.Characters.Font.ColorIndex = 1
Worksheets("Dashboard").Shapes("Rounded Rectangle 7").Fill.Transparency = False
ActiveSheet.Range("A1").Select
Else
ToggleButton1.Picture = Image5.Picture
Worksheets("Dashboard").Shapes("Rounded Rectangle 7").Fill.Transparency = 0.5
ActiveSheet.Range("A1").Select
But how do I need to change the code to refer on the pictures on the worksheet?
I tried this:
ToggleButton1.Picture = Worksheets("Dashboard").Shapes.Image3.Picture
but this doesn't work.
Thanks in advance for your help!!
Greets,
Sari
I would like to setup some toggle buttons. In my document I have one main-sheet (dashboard) and 29 sub-sheets. On all 29 worksheets I need one toggle button which changes the embedded picture if the value is true or false.
To make sure I don't create an Excel file which has an enourmous size, I would like to insert the 2 pictures on the dashboard and refer from each worksheet toggle button on it.
Unfortunately it only works if I insert the pictures on the same sheet where the toggle button is and this would mean that I need to add 58 pictures to the Excel file.
My file is now almost 6MB, so I need to take care that I won't get too big.
This is the code which works if I add it to every worksheet:
If ToggleButton1.Value = True Then
ToggleButton1.Picture = Image6.Picture
Worksheets("Dashboard").Shapes("Rounded Rectangle 7").TextFrame.Characters.Font.ColorIndex = 1
Worksheets("Dashboard").Shapes("Rounded Rectangle 7").Fill.Transparency = False
ActiveSheet.Range("A1").Select
Else
ToggleButton1.Picture = Image5.Picture
Worksheets("Dashboard").Shapes("Rounded Rectangle 7").Fill.Transparency = 0.5
ActiveSheet.Range("A1").Select
But how do I need to change the code to refer on the pictures on the worksheet?
I tried this:
ToggleButton1.Picture = Worksheets("Dashboard").Shapes.Image3.Picture
but this doesn't work.
Thanks in advance for your help!!
Greets,
Sari