467,892 Members | 1,857 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,892 developers. It's quick & easy.

A question of Excel...

Howdy all

I currently have a program in VB6.0 (with all the correct Project Refs
included) that creates an excel spreadsheet.
This program runs fine, inserts all the correct data in the correct
places....the problem I am having is this....

How can i have a gridline that only draws the OUTER LINES of the box, not
the internal lines as well...I've tried everything...

Range("A3").Borders.Value = xlEdgeLeft
Range("A3:AE14").Borders.Value = xlEdgeLeft

despite that, it draws all the internal lines as well...Im stuck...please
help....

Running XP and office XP

Thanks
Jul 17 '05 #1
  • viewed: 7025
Share:
2 Replies
When learning Word or Excel coding let the application teach you.
Simply turn on record macro, do what you want, stop the recorder
and then open the visual basic editor and see what the code is.

Take Care
Charlie

Example code is below:

Range("E7:G13").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone

"|\/|onkey" <lp**@ber.co.uk> wrote in message
news:ay**************@news-binary.blueyonder.co.uk...
Howdy all

I currently have a program in VB6.0 (with all the correct Project Refs
included) that creates an excel spreadsheet.
This program runs fine, inserts all the correct data in the correct
places....the problem I am having is this....

How can i have a gridline that only draws the OUTER LINES of the box, not
the internal lines as well...I've tried everything...

Range("A3").Borders.Value = xlEdgeLeft
Range("A3:AE14").Borders.Value = xlEdgeLeft

despite that, it draws all the internal lines as well...Im stuck...please
help....

Running XP and office XP

Thanks

Jul 17 '05 #2
Try:

With Range("A3:AE14")
.Borders(xlEdgeTop).LineStyle = xlContinuous
.Borders(xlEdgeLeft).LineStyle = xlContinuous
.Borders(xlEdgeBottom).LineStyle = xlContinuous
.Borders(xlEdgeRight).LineStyle = xlContinuous
End with
"|\/|onkey" <lp**@ber.co.uk> wrote in message
news:ay**************@news-binary.blueyonder.co.uk...
Howdy all

I currently have a program in VB6.0 (with all the correct Project Refs
included) that creates an excel spreadsheet.
This program runs fine, inserts all the correct data in the correct
places....the problem I am having is this....

How can i have a gridline that only draws the OUTER LINES of the box, not
the internal lines as well...I've tried everything...

Range("A3").Borders.Value = xlEdgeLeft
Range("A3:AE14").Borders.Value = xlEdgeLeft

despite that, it draws all the internal lines as well...Im stuck...please
help....

Running XP and office XP

Thanks

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by Allison Bailey | last post: by
6 posts views Thread by Matthew Wieder | last post: by
14 posts views Thread by pmud | last post: by
22 posts views Thread by Howard Kaikow | last post: by
7 posts views Thread by Alain \Mbuna\ | last post: by
9 posts views Thread by Doug Glancy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.