Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default API to draw borders

Hi

I wanted to know if there is any programmer API to draw a border around ranges in Excel. I basically want to demaracate cells the way Excel does it while showing ranges involved in a formula. Is this border functionality exposed to developers

On the same lines, I also want to draw arrows across cells, the way I Excel does when it shows precedents and dependents

Any pointers will be highly appreciated

Bharath
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default API to draw borders

Bharath,

You can use the BorderAround method to draw a border around a
range of cells. E.g.,

Range("C3:F5").BorderAround LineStyle:=xlSolid, Weight:=xlMedium

You can draw arrows with code like

Dim SH As Shape
Set SH = ActiveSheet.Shapes.AddLine(beginx:=Range("C3").Lef t, _
beginy:=Range("C3").Top, endx:=Range("F5").Left, _
endy:=Range("F5").Top)
SH.Line.EndArrowheadStyle = msoArrowheadTriangle

See the XRay game on my web site for lots of examples of drawing
lines on a worksheet: http://www.cpearson.com/excel/download.htm


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






"Bharath" wrote in message
...
Hi,

I wanted to know if there is any programmer API to draw a

border around ranges in Excel. I basically want to demaracate
cells the way Excel does it while showing ranges involved in a
formula. Is this border functionality exposed to developers?

On the same lines, I also want to draw arrows across cells, the

way I Excel does when it shows precedents and dependents.

Any pointers will be highly appreciated.

Bharath



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default API to draw borders

Hi

Thanks Chip. That was useful

The issue I had with BorderAround is, if there's an already existing border in a decorated Excel sheet (most Excel sheets are), then this will override that, and its hard to get back the original one. I felt the way Excel shows borders of ranges while editing formulae was neat, and wanted to know if there's an API for that

Regards
Bharath
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default API to draw borders

Chip,

That's excellent! It puts all my border drawing routines to shame. I bet you
can imagine what code might look like without knowledge of BorderAround ;)

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Chip Pearson" wrote in message
...
Bharath,

You can use the BorderAround method to draw a border around a
range of cells. E.g.,

Range("C3:F5").BorderAround LineStyle:=xlSolid, Weight:=xlMedium

You can draw arrows with code like

Dim SH As Shape
Set SH = ActiveSheet.Shapes.AddLine(beginx:=Range("C3").Lef t, _
beginy:=Range("C3").Top, endx:=Range("F5").Left, _
endy:=Range("F5").Top)
SH.Line.EndArrowheadStyle = msoArrowheadTriangle

See the XRay game on my web site for lots of examples of drawing
lines on a worksheet: http://www.cpearson.com/excel/download.htm


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






"Bharath" wrote in message
...
Hi,

I wanted to know if there is any programmer API to draw a

border around ranges in Excel. I basically want to demaracate
cells the way Excel does it while showing ranges involved in a
formula. Is this border functionality exposed to developers?

On the same lines, I also want to draw arrows across cells, the

way I Excel does when it shows precedents and dependents.

Any pointers will be highly appreciated.

Bharath





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
draw corners Tim Myers Excel Discussion (Misc queries) 5 March 11th 10 08:56 AM
draw a line Yara Excel Discussion (Misc queries) 0 October 9th 07 08:16 PM
VBA to draw lines of SPC Daniel Charts and Charting in Excel 4 July 31st 07 08:44 PM
how do I draw a historgram? neksejan Charts and Charting in Excel 2 May 20th 07 03:58 PM
How draw x-y picture ZPXY Charts and Charting in Excel 1 December 13th 05 12:28 AM


All times are GMT +1. The time now is 03:46 AM.

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"