Clear all borders with VBA

  • Thread starter Thread starter Otto Moehrbach
  • Start date Start date
O

Otto Moehrbach

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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top