ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Clear all borders with VBA (https://www.excelbanter.com/excel-programming/379940-clear-all-borders-vba.html)

Otto Moehrbach

Clear all borders with VBA
 
Excel XP, Win XP
When I record a macro to clear all borders in the selection, the recorder of
course comes back with a list of:
ThisBorder = xlNone
ThatBorder = xlNone
Etc
Etc.
What is the single statement that clears all borders in the selection?
Thanks for your time. Otto



John Bundy

Clear all borders with VBA
 
Try this

Range("H8:L22").Select
Selection.Borders.LineStyle = xlNone
--
-John Northwest11
Please rate when your question is answered to help us and others know what
is helpful.


"Otto Moehrbach" wrote:

Excel XP, Win XP
When I record a macro to clear all borders in the selection, the recorder of
course comes back with a list of:
ThisBorder = xlNone
ThatBorder = xlNone
Etc
Etc.
What is the single statement that clears all borders in the selection?
Thanks for your time. Otto




Gary Keramidas

Clear all borders with VBA
 
how about something like this

Sub test()
Dim b As Border
Dim rng As Range
Set rng = Range("e3:j11")
For Each b In rng.Borders
b.LineStyle = xlNone
Next
End Sub

or this

Sub test2()
Dim b As Border
For Each b In Selection.Borders
b.LineStyle = xlNone
Next
End Sub

--


Gary


"Otto Moehrbach" wrote in message
...
Excel XP, Win XP
When I record a macro to clear all borders in the selection, the recorder of
course comes back with a list of:
ThisBorder = xlNone
ThatBorder = xlNone
Etc
Etc.
What is the single statement that clears all borders in the selection? Thanks
for your time. Otto





All times are GMT +1. The time now is 10:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com