Any way to change line weight of bordered cells only ?

B

Bill Weylock

Hope one of you macro wizards may have a workaround for this.

An assistant just sent me a large worksheet with cross-tab tables for dozens
of survey questions. I haven¹t counted, but I think there are probably 150
tables.

He has used a heavy black line to border all cells, making the numbers
harder to read than they should be.

I know how to set line width/weight for borders, but of course I don¹t want
to set it for every cell or the tables will disappear. Now there are no
gridlines showing between the tables.

Is there any way to change the weight only for cells that already have
borders???

At the same time I am of course asking him if he can change the initial
setting, but he is outputting from a SAS analytical program that may not
have many formatting options.

Thanks for anything you can suggest!!


Very best,

- Bill




Panther 10.3.6
Office 2004

Windows XP Pro SP2
Office 2003
 
J

JE McGimpsey

Bill Weylock said:
Is there any way to change the weight only for cells that already have
borders???

Well this is no speed-demon, but it seems to work:

Public Sub ThinBorders()
Dim rCell As Range
Dim brBorder As Border
Application.ScreenUpdating = False
For Each rCell In Selection
For Each brBorder In rCell.Borders
If brBorder.LineStyle <> xlNone Then _
brBorder.Weight = xlThin
Next brBorder
Next rCell
Application.ScreenUpdating = True
End Sub


Change Selection to ActiveSheet.UsedRange if you want don't want to
select the areas first - but it will be quite a bit slower.
 

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

Top