+ Reply to Thread
Results 1 to 2 of 2

Need coding to DELETE a line on a spreadsheet.

  1. #1
    Ed
    Guest

    Need coding to DELETE a line on a spreadsheet.

    Hi

    With Worksheets("SpeedPlay").Shapes.AddLine(546, 90, 546, 114)
    ..Line.ForeColor.RGB = RGB(0, 0, 0)
    End With

    The preceding Macro code adds a black line of a certain length and in a
    certain place on a spreadsheet named SpeedPlay.

    What I need is the coding to DELETE (remove) this same line.
    Is that possible?

    Thankyou
    Ed

  2. #2
    Chip Pearson
    Guest

    Re: Need coding to DELETE a line on a spreadsheet.

    Ed,

    Give the line a name,

    With Worksheets("SpeedPlay").Shapes.AddLine(546, 90, 546, 114)
    ..Line.ForeColor.RGB = RGB(0, 0, 0)
    ..Name = "TheLine"
    End With

    Then, reference the line via the Shapes collection and delete it.

    Worksheets("SpeedPlay").Shapes("TheLine").Delete


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com


    "Ed" <[email protected]> wrote in message
    news:[email protected]...
    > Hi
    >
    > With Worksheets("SpeedPlay").Shapes.AddLine(546, 90, 546, 114)
    > .Line.ForeColor.RGB = RGB(0, 0, 0)
    > End With
    >
    > The preceding Macro code adds a black line of a certain length
    > and in a
    > certain place on a spreadsheet named SpeedPlay.
    >
    > What I need is the coding to DELETE (remove) this same line.
    > Is that possible?
    >
    > Thankyou
    > Ed




+ 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