![]() |
For Each Subtotal/Bold, Add xlDouble
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 Ive done it before, on another project, but I cant find the code anywhere in my library of code. Please help! Thanks, Ryan--- -- RyGuy |
For Each Subtotal/Bold, Add xlDouble
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 "ryguy7272" wrote: 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 Ive done it before, on another project, but I cant find the code anywhere in my library of code. Please help! Thanks, Ryan--- -- RyGuy |
For Each Subtotal/Bold, Add xlDouble
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 -- Rick (MVP - Excel) "ryguy7272" wrote in message ... 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 Ive done it before, on another project, but I cant find the code anywhere in my library of code. Please help! Thanks, Ryan--- -- RyGuy |
For Each Subtotal/Bold, Add xlDouble
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--- -- RyGuy "Rick Rothstein" wrote: 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 -- Rick (MVP - Excel) "ryguy7272" wrote in message ... 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 Ive done it before, on another project, but I cant find the code anywhere in my library of code. Please help! Thanks, Ryan--- -- RyGuy |
All times are GMT +1. The time now is 07:10 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com