For Each Subtotal/Bold, Add xlDouble

R

ryguy7272

For each cell with bold text, which is actually a subtotal, how can I
underscore the cell, with double lines, and have the same, extending 8 cells
to the right of this? The subtotals are in column C. I figure it will be
something like this:

For each

With Selection.Borders(xlEdgeBottom)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = xlAutomatic
End With

Next

I’ve done it before, on another project, but I can’t find the code anywhere
in my library of code. Please help!

Thanks,
Ryan---
 
R

Rob Wills

Give this a go.....

dim Rng as Range

For each Rng in Range("C1:C" &
Range("A1").SpecialCells(xlCellTypeLastCell).Row)

if rng.font.bold then
With rng.Borders(xlEdgeBottom)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
end if
Next rng


HTH
Rob
 
R

Rick Rothstein

Give this macro a try...

Sub PlaceBottomDoubleBorderLines()
Dim C As Range
For Each C In Range("C1").Resize(Cells(Rows.Count, "C").End(xlUp).Row)
If C.Font.Bold Then
With C.Resize(, 8).Borders(xlEdgeBottom)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
End If
Next
End Sub
 
R

ryguy7272

Rob, it just underlined the cells in Column C, but that's ok; I can work with
it. Rick, worked exactly as I expected. Now, I'm going to save this code in
a safe place and I'll know where to find it next time I need it!!

Thanks guys!!
Ryan---
 

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