Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a drop-down menu on one worksheet in a workbook with choices of Left &
Right. The result is linked to a cell on that sheet. I want to turn a rectangle shape on or off on another worksheet in the same workbook depending on whether I select Left or Right. How would one do that? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Select the sheet tab which you want to work with. Right click the sheet tab
and click on 'View Code'. This will launch VBE. Paste the below code to the right blank portion. Get back to to workbook and try out. Private Sub Worksheet_Change(ByVal Target As Range) Application.EnableEvents = False If Not Application.Intersect(Target, Range("A1")) Is Nothing Then If Range("A1") = "Left" Then Me.Shapes("Rectangle 9").Visible = True If Range("A1") = "Right" Then Me.Shapes("Rectangle 9").Visible = False End If Application.EnableEvents = True End Sub If this post helps click Yes --------------- Jacob Skaria "Jarla61" wrote: I have a drop-down menu on one worksheet in a workbook with choices of Left & Right. The result is linked to a cell on that sheet. I want to turn a rectangle shape on or off on another worksheet in the same workbook depending on whether I select Left or Right. How would one do that? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you are familiar with VBA
you could try this code to hide or unhide the shape: Private Sub ComboBox1_Change() If Me.ComboBox1.Value = "Left" Then ActiveSheet.Shapes("rectangle 2").Visible = False Else ActiveSheet.Shapes("rectangle 2").Visible = True End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
import shape from other sheet based on destination sheet data | Excel Programming | |||
Run code conditional on sheet visibility | Excel Programming | |||
Ensure macros enabled - C. Pearson's sheet visibility method | Excel Programming | |||
Toggle sheet visibility | Excel Programming | |||
Show & Hide Shape in a Sheet | Excel Programming |