Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Give this a whirl...
sub test Range("A1:B50").Borders.LineStyle = xlNone end sub -- HTH... Jim Thomlinson "Finance Guru" wrote: Hi All, I know how to clear the contents of cells in a macro,ie. Range("A1:B50").ClearContents - however can anyone tell me what needs to be included in a macro to clear "Borders" created around cells for a given range. I am just getting into creating macros - so if the above is not clear,please let me know. Thank you |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
To account for diagonals revise to this.
Sub test() With Range("A1:B50") .Borders.LineStyle = xlNone .Borders(xlDiagonalDown).LineStyle = xlNone .Borders(xlDiagonalUp).LineStyle = xlNone End With End Sub Gord Dibben MS Excel MVP On Wed, 21 Nov 2007 10:15:02 -0800, Jim Thomlinson wrote: Give this a whirl... sub test Range("A1:B50").Borders.LineStyle = xlNone end sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
And I just learned something new. I did not realize that my original code did
not remove the diagonals. That being said I can honestly say I have never used the diagonals... but if I ever do... Thanks Gord -- HTH... Jim Thomlinson "Gord Dibben" wrote: To account for diagonals revise to this. Sub test() With Range("A1:B50") .Borders.LineStyle = xlNone .Borders(xlDiagonalDown).LineStyle = xlNone .Borders(xlDiagonalUp).LineStyle = xlNone End With End Sub Gord Dibben MS Excel MVP On Wed, 21 Nov 2007 10:15:02 -0800, Jim Thomlinson wrote: Give this a whirl... sub test Range("A1:B50").Borders.LineStyle = xlNone end sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Not only doesn't it remove diagonals, it adds diagonals to cells in the range
that don't originally have them. Set A1:B10 with cell borders and include diagonals. Run your original macro. Clears the outside and interior borders in A1:B10 but leaves the diagonals and also adds them to A11:B50 Note: the diagonals are actually doubled up so if you go to FormatCellBorders you have to click twice to clear them. Not nice and definitely weird<g Gord On Wed, 21 Nov 2007 11:54:04 -0800, Jim Thomlinson wrote: And I just learned something new. I did not realize that my original code did not remove the diagonals. That being said I can honestly say I have never used the diagonals... but if I ever do... Thanks Gord |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Spookey... This one darn near fits into JWalk's XL oddities.
This has re-affirmed my desire to just never use diagonals. That being said many moons from now I am going to break down and use them for some obscure reason and my code will mess them up. On that day I will (vaguely) recall this conversation with a sense of (told you so)... -- HTH... Jim Thomlinson "Gord Dibben" wrote: Not only doesn't it remove diagonals, it adds diagonals to cells in the range that don't originally have them. Set A1:B10 with cell borders and include diagonals. Run your original macro. Clears the outside and interior borders in A1:B10 but leaves the diagonals and also adds them to A11:B50 Note: the diagonals are actually doubled up so if you go to FormatCellBorders you have to click twice to clear them. Not nice and definitely weird<g Gord On Wed, 21 Nov 2007 11:54:04 -0800, Jim Thomlinson wrote: And I just learned something new. I did not realize that my original code did not remove the diagonals. That being said I can honestly say I have never used the diagonals... but if I ever do... Thanks Gord |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Clear cell borders for blank white page | Excel Discussion (Misc queries) | |||
Clear cell borders for blank white page | Excel Discussion (Misc queries) | |||
Clear all borders with VBA | Excel Programming | |||
A MACRO TO BUILD BORDERS | Excel Programming | |||
Using a macro to add borders | Excel Programming |