+ Reply to Thread
Results 1 to 2 of 2

Suggestions for this macro:)

Hybrid View

  1. #1
    Registered User
    Join Date
    11-02-2004
    Location
    Slovenia, LJ
    MS-Off Ver
    2007
    Posts
    40

    Suggestions for this macro:)

    Hello,

    Any suggestions to write this macro on different (more sofisticated) way?
    1)
    Private Sub CheckBox1_Change()
    If CheckBox1.Value = True Then
    ActiveSheet.Shapes("KT2").Select
    Selection.ShapeRange.LINE.Visible = msoTrue
    Range("A1").Select
    Else
    ActiveSheet.Shapes("KT2").Select
    Selection.ShapeRange.LINE.Visible = msoFalse
    Range("A1").Select
    End If
    End Sub

    2)
    ActiveSheet.Shapes.Range(Layer_KT2).Select
    Selection.ShapeRange.Group.Select
    Selection.Name = "KT2"


    Thank you, Drile

    PS: As you see, I used Range("A1").Select to deselect shapes. Is it possible to deselect shapes on different way (how could I "model" the Escape button with VBA).

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Try making your changes without selecting the shape.

    I don't work with shapes so I am basing my suggestion on what works with workbooks, sheets, cells etc

    If CheckBox1.Value = True Then
    ActiveSheet.Shapes("KT2").ShapeRange.Line.Visible = msoTrue
    Else
    ActiveSheet.Shapes("KT2").ShapeRange.Line.Visible = msoFalse
    End If
    End Sub
    
    2)
    ActiveSheet.Shapes.Range(Layer_KT2).ShapeRange.Group.Name = "KT2"

+ 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