Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 279
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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" wrote in message
...
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
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
Challenge - Excel Line Feed Character CHR(10) - How to Delete and keep the text formatting without going ro single line in a cell ? No Name Excel Worksheet Functions 7 October 7th 09 11:10 AM
How do I add a line every 3 lines in a 5600 line spreadsheet? Karen Rosenberger Excel Discussion (Misc queries) 2 September 25th 09 12:45 AM
Color coding data in line graphs brewer Charts and Charting in Excel 1 July 28th 09 06:17 PM
COLOR CODING A PROFIT & LOSS SPREADSHEET Todd Excel Discussion (Misc queries) 1 March 1st 08 02:05 PM
Is there a way to insert a formula, password or macro in an excel spreadsheet that will automatically delete the spreadsheet? oil_driller Excel Discussion (Misc queries) 1 February 8th 05 09:34 AM


All times are GMT +1. The time now is 05:15 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"