I have a macro that inserts text "Total in Column A three rows after the last item and totals up the value in Col E three rows after the last value
I have would like to add code that will put a thick box border starting where the text Total has been inserted up to Col E in line with the word Total
I have written code to do put a thick box border around total aright up to the total value in Col E, but it does nothing. The code that inserts the text "Total" in Col A and the Value in Col E is correct.
Your assistance will be most appreciated
Finalrow = Range("A65536").End(xlUp).Row
Range("A" & Finalrow + 1).Resize(12, 12).ClearContents
Range("A" & Finalrow + 3).Value = "Total Value"
Range("E" & Finalrow + 3).Formula = "=sum(E3:E" & Finalrow & ")"
Range("A1").Select
With Range("D:D")
.TextToColumns Destination:=Range("D1"), DataType:=xlFixedWidth, _
FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
End With
Range("E" & Finalrow + 3).NumberFormat = "#,##0.00;(#,##0.00)"
Range("A" & Finalrow + 3).Resize(, 5).Font.Bold = True
Range("A" & Finalrow).Resize(, 5).Borders(xlDiagonalDown).LineStyle = xlNone
Range("A" & Finalrow).Resize(, 5).Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlMedium
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlMedium
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlMedium
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlMedium
End With
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
End Sub
I have would like to add code that will put a thick box border starting where the text Total has been inserted up to Col E in line with the word Total
I have written code to do put a thick box border around total aright up to the total value in Col E, but it does nothing. The code that inserts the text "Total" in Col A and the Value in Col E is correct.
Your assistance will be most appreciated
Finalrow = Range("A65536").End(xlUp).Row
Range("A" & Finalrow + 1).Resize(12, 12).ClearContents
Range("A" & Finalrow + 3).Value = "Total Value"
Range("E" & Finalrow + 3).Formula = "=sum(E3:E" & Finalrow & ")"
Range("A1").Select
With Range("D:D")
.TextToColumns Destination:=Range("D1"), DataType:=xlFixedWidth, _
FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
End With
Range("E" & Finalrow + 3).NumberFormat = "#,##0.00;(#,##0.00)"
Range("A" & Finalrow + 3).Resize(, 5).Font.Bold = True
Range("A" & Finalrow).Resize(, 5).Borders(xlDiagonalDown).LineStyle = xlNone
Range("A" & Finalrow).Resize(, 5).Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlMedium
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlMedium
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlMedium
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlMedium
End With
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
End Sub