I know I said I didn't want to use macros, but here it is:
Sub changetoblue()
Dim r As Range
Dim o As Border
Application.ScreenUpdating = False
For Each r In Selection
For Each o In r.Borders
If o.LineStyle <> xlNone Then
o.Color = RGB(0, 0, 255)
End If
Next o
Next
Application.ScreenUpdating = True
End Sub
As you can see, the macro only changes the border if it exists, but it will
not modify the current border style.
I know that I am doing twice the work needed here because each border gets
checked two times, but as I said, it was only because I really needed to do
this.
Thanks anyways Franz.
"Franz" wrote:
> "Mexage" <Mexage@discussions.microsoft.com>ha scritto nel messaggio
> FFA36373-1CC8-4A7E-B178-3C26A9535CFF@microsoft.com
>
> > I am working in excel 2003. I have various sheets with a number of
> > tables in each one. I need to change the color of the table borders
> > without doing anything to the border style. When I try using the
> > Format/Cells option, and then in the borders tab, I can see the table
> > lines divided with a gray (generic) style because my selection has
> > different types of styles. When I change the color, it will not apply
> > the changes because I don't click on the grayed borders (if I did, it
> > would reset my styles, which is an undesired effect)
> >
> > I don't really want to use macros (because I think this should be an
> > easy task for excel). Gee, I wish I had used styles before starting
> > to design the worksheet.
>
> If I have well understood, all tou have to do is to select your table, then
> from Format/Cell option select the borders tab, select the style and the
> color of the line to apply and *then* click on each side of the rectangle
> that represent your table.
>
>
> --
> Hoping to be helpful...
>
> Regards
>
> Franz
>
> ----------------------------------------------------------------------------------------
> To reply translate from italian InVento (no capital letters)
> ----------------------------------------------------------------------------------------
>
>
>
Bookmarks