Bolding Specific Cell Formula Question

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?
 
G

Guest

Yeah I made that WAYYY to complicated. I figured it out in a wonderful
moment of clarity. Thanks though for everyone's help!!!

LastRow = Cells(Rows.Count, "W").End(xlUp).Row
Cells(LastRow + 2, "W") .Select
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
 

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

Similar Threads

Micro to do borders question. 3
Border Problem 2
VBA code question 1
Macro: Insert Row above Totals 6
with, end with format 2
Shorten a Macro 7
JLatham MVP (Macro) 3
Help with macro 1

Top