ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Changing table border color (https://www.excelbanter.com/excel-discussion-misc-queries/25922-changing-table-border-color.html)

Mexage

Changing table border color
 
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.

Thanks!

Franz

"Mexage" ha scritto nel messaggio


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



Mexage

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" ha scritto nel messaggio


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




Franz Verga

"Mexage" ha scritto nel messaggio



Thanks anyways Franz.


Your welcome, thanks for feedback.


--
Hoping to be helpful...

Regards

Franz Verga

----------------------------------------------------------------------------------------
To reply translate from italian InVento (no capital letters)
----------------------------------------------------------------------------------------




All times are GMT +1. The time now is 11:46 PM.

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