Yjmmay34
07-29-2010, 07:25 PM
Hi, all.
i need a macro to help me extend the border line until "GLOBAL ACCOUNTS Total ". how should i write a macro to do it automatically?? pls check the attachment.
thank you!
and i used to extend the border line use the code below, but this is to extend the bottom line. Then how about the attachment i attached below? how should i edit the code?
GrandTotalRowCount = 0
i = 1
Do While ActiveSheet.Cells(i, 1) <> "GLOBAL ACCOUNTS Total"
GrandTotalRowCount = GrandTotalRowCount + 1
i = i + 1
Loop
GrandTotalRowCount = GrandTotalRowCount + 1
For k = 1 To GrandTotalRowCount
If Cells(k, "A").Borders(xlEdgeBottom).LineStyle <> xlNone Then
With Cells(k, "A").Resize(, 26).Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
End With
End If
Next k
i need a macro to help me extend the border line until "GLOBAL ACCOUNTS Total ". how should i write a macro to do it automatically?? pls check the attachment.
thank you!
and i used to extend the border line use the code below, but this is to extend the bottom line. Then how about the attachment i attached below? how should i edit the code?
GrandTotalRowCount = 0
i = 1
Do While ActiveSheet.Cells(i, 1) <> "GLOBAL ACCOUNTS Total"
GrandTotalRowCount = GrandTotalRowCount + 1
i = i + 1
Loop
GrandTotalRowCount = GrandTotalRowCount + 1
For k = 1 To GrandTotalRowCount
If Cells(k, "A").Borders(xlEdgeBottom).LineStyle <> xlNone Then
With Cells(k, "A").Resize(, 26).Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
End With
End If
Next k