G
Guest
I am trying to have a specific border placed around a subtotaled cell that is
selected by a formula. I have both separate formulas, and am trying to do it
by combining these two separate ones. BUT, I'm at a loss. I need to learn
this stuff better sorry for my novice questions. Okay, here's what I'm
trying to combine:
This is how I have it selecting the second empty cell below the column and
doing a subtotal of the entire column (THANKS DON!!):
LastRow = Cells(Rows.Count, "W").End(xlUp).Row
Cells(LastRow + 2, "W") = Application.Sum _
(Range(Cells(1, "W"), Cells(LastRow, "W")))
This is the border formula (actually managed this on on me own, painfully):
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlEdgeRight).LineStyle = xlNone
End Sub
am I making this WAY too complicated?
selected by a formula. I have both separate formulas, and am trying to do it
by combining these two separate ones. BUT, I'm at a loss. I need to learn
this stuff better sorry for my novice questions. Okay, here's what I'm
trying to combine:
This is how I have it selecting the second empty cell below the column and
doing a subtotal of the entire column (THANKS DON!!):
LastRow = Cells(Rows.Count, "W").End(xlUp).Row
Cells(LastRow + 2, "W") = Application.Sum _
(Range(Cells(1, "W"), Cells(LastRow, "W")))
This is the border formula (actually managed this on on me own, painfully):
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlEdgeRight).LineStyle = xlNone
End Sub
am I making this WAY too complicated?