Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I turn the visibility of a shape on one sheet off and on?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default How do I turn the visibility of a shape on one sheet off and on?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default How do I turn the visibility of a shape on one sheet off and on?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
import shape from other sheet based on destination sheet data thole Excel Programming 7 May 6th 09 02:11 PM
Run code conditional on sheet visibility Sandy Excel Programming 16 November 23rd 08 02:55 PM
Ensure macros enabled - C. Pearson's sheet visibility method Horatio J. Bilge, Jr. Excel Programming 0 December 3rd 07 05:36 PM
Toggle sheet visibility John[_130_] Excel Programming 2 October 11th 07 02:04 AM
Show & Hide Shape in a Sheet Pete Csiszar[_2_] Excel Programming 3 January 15th 05 01:37 AM


All times are GMT +1. The time now is 06:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"