+ Reply to Thread
Results 1 to 3 of 3

Hide/Show Shapes on Worksheet??

  1. #1
    Ken Loomis
    Guest

    Hide/Show Shapes on Worksheet??

    I am trying to create subs to hide or show certain shapes on a worksheet.

    When I use the macro recorder to do that, I get this sub:

    ' Macro11 Macro
    ' Macro recorded 6/27/2005 by Ken Loomis
    '

    '
    Selection.ShapeRange.Fill.Visible = msoTrue
    Selection.ShapeRange.Fill.Solid
    Selection.ShapeRange.Fill.ForeColor.SchemeColor = 8
    Selection.ShapeRange.Fill.Transparency = 0#
    Selection.ShapeRange.Line.Weight = 0.75
    Selection.ShapeRange.Line.DashStyle = msoLineSolid
    Selection.ShapeRange.Line.Style = msoLineSingle
    Selection.ShapeRange.Line.Transparency = 0#
    Selection.ShapeRange.Line.Visible = msoTrue
    Selection.ShapeRange.Line.ForeColor.SchemeColor = 8
    Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)
    End Sub

    So I thought I could use this sub for a specific shape:

    Sub HideStudentHoursBubbles()
    With ActiveSheet.Shapes("StdntHrsBbl1")
    .Fill.Visible = msoFalse
    .Fill.Solid
    .Fill.Transparency = 0#
    .Line.Weight = 0.75
    .Line.DashStyle = msoLineSolid
    .Line.Style = msoLineSingle
    .Line.Transparency = 0#
    .Line.Visible = msoFalse
    End With
    End Sub

    This seems to make no change to the shape at all and nothing I try seems toi
    have an effect.

    Can someone pleae help?

    TIA,
    Ken Loomis





  2. #2
    Norman Jones
    Guest

    Re: Hide/Show Shapes on Worksheet??

    Hi Ken,

    Try:

    ActiveSheet.Shapes("StdntHrsBbl1").Visible = False

    ---
    Regards,
    Norman



    "Ken Loomis" <[email protected]> wrote in message
    news:[email protected]...
    >I am trying to create subs to hide or show certain shapes on a worksheet.
    >
    > When I use the macro recorder to do that, I get this sub:
    >
    > ' Macro11 Macro
    > ' Macro recorded 6/27/2005 by Ken Loomis
    > '
    >
    > '
    > Selection.ShapeRange.Fill.Visible = msoTrue
    > Selection.ShapeRange.Fill.Solid
    > Selection.ShapeRange.Fill.ForeColor.SchemeColor = 8
    > Selection.ShapeRange.Fill.Transparency = 0#
    > Selection.ShapeRange.Line.Weight = 0.75
    > Selection.ShapeRange.Line.DashStyle = msoLineSolid
    > Selection.ShapeRange.Line.Style = msoLineSingle
    > Selection.ShapeRange.Line.Transparency = 0#
    > Selection.ShapeRange.Line.Visible = msoTrue
    > Selection.ShapeRange.Line.ForeColor.SchemeColor = 8
    > Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)
    > End Sub
    >
    > So I thought I could use this sub for a specific shape:
    >
    > Sub HideStudentHoursBubbles()
    > With ActiveSheet.Shapes("StdntHrsBbl1")
    > .Fill.Visible = msoFalse
    > .Fill.Solid
    > .Fill.Transparency = 0#
    > .Line.Weight = 0.75
    > .Line.DashStyle = msoLineSolid
    > .Line.Style = msoLineSingle
    > .Line.Transparency = 0#
    > .Line.Visible = msoFalse
    > End With
    > End Sub
    >
    > This seems to make no change to the shape at all and nothing I try seems
    > toi have an effect.
    >
    > Can someone pleae help?
    >
    > TIA,
    > Ken Loomis
    >
    >
    >
    >




  3. #3
    Ken Loomis
    Guest

    Re: Hide/Show Shapes on Worksheet??

    Thanks, Norman. That works great.

    Still don't understand why the other code didn't work, but at least I have
    something that does work.

    Ken


    "Norman Jones" <[email protected]> wrote in message
    news:%[email protected]...
    > Hi Ken,
    >
    > Try:
    >
    > ActiveSheet.Shapes("StdntHrsBbl1").Visible = False
    >
    > ---
    > Regards,
    > Norman
    >
    >
    >
    > "Ken Loomis" <[email protected]> wrote in message
    > news:[email protected]...
    >>I am trying to create subs to hide or show certain shapes on a worksheet.
    >>
    >> When I use the macro recorder to do that, I get this sub:
    >>
    >> ' Macro11 Macro
    >> ' Macro recorded 6/27/2005 by Ken Loomis
    >> '
    >>
    >> '
    >> Selection.ShapeRange.Fill.Visible = msoTrue
    >> Selection.ShapeRange.Fill.Solid
    >> Selection.ShapeRange.Fill.ForeColor.SchemeColor = 8
    >> Selection.ShapeRange.Fill.Transparency = 0#
    >> Selection.ShapeRange.Line.Weight = 0.75
    >> Selection.ShapeRange.Line.DashStyle = msoLineSolid
    >> Selection.ShapeRange.Line.Style = msoLineSingle
    >> Selection.ShapeRange.Line.Transparency = 0#
    >> Selection.ShapeRange.Line.Visible = msoTrue
    >> Selection.ShapeRange.Line.ForeColor.SchemeColor = 8
    >> Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)
    >> End Sub
    >>
    >> So I thought I could use this sub for a specific shape:
    >>
    >> Sub HideStudentHoursBubbles()
    >> With ActiveSheet.Shapes("StdntHrsBbl1")
    >> .Fill.Visible = msoFalse
    >> .Fill.Solid
    >> .Fill.Transparency = 0#
    >> .Line.Weight = 0.75
    >> .Line.DashStyle = msoLineSolid
    >> .Line.Style = msoLineSingle
    >> .Line.Transparency = 0#
    >> .Line.Visible = msoFalse
    >> End With
    >> End Sub
    >>
    >> This seems to make no change to the shape at all and nothing I try seems
    >> toi have an effect.
    >>
    >> Can someone pleae help?
    >>
    >> TIA,
    >> Ken Loomis
    >>
    >>
    >>
    >>

    >
    >




+ 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