+ Reply to Thread
Results 1 to 2 of 2

How to make a shape display when a cell is click.

Hybrid View

  1. #1
    Registered User
    Join Date
    10-21-2009
    Location
    Minnesota
    MS-Off Ver
    Excel 2003
    Posts
    5

    How to make a shape display when a cell is click.

    Need help with programming.
    This is what I am trying to do:

    When a user click on a cell in column A, a shape appears. And when they click on a cell other than a cell in column A, a shape disappears. The cell in Column A has no value.

    Here is my code so far:
    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim r As Excel.Range
    Set r = Me.Range("A140:A150")
    
    With ActiveSheet.Shapes("Create_New_Row")
    If Target.Value = "new" Then
    .Visible = True
    Else
    .Visible = False
    End If
    End With
    End Sub
    Please help...

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: How to make a shape display when a cell is click.

    Maybe like this:
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
        ActiveSheet.Shapes("Create_New_Row").Visible = Target.Column = 1
    End Sub
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1