Hookay... Skip had posted this section of code in the past and frankly it does pretty much everything I need it to do but strangely enough I'm getting an undeclared on the linestyle formatting (ie xlThin, xlContinuous). I am importing the microsoft.office.interop so not sure why I'm getting the error. Suggestions?
Sub UndTot2()
Set rTotal = Range("A:A").Find(What:="Grand Total", _
After:=Cells(1, 1), _
LookIn:=xlValues, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not rTotal Is Nothing Then
With Range(rTotal, rTotal.Offset(0, 4))
With .Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
End With
With .Borders(xlEdgeBottom)
.LineStyle = xlDouble
.Weight = xlThick
End With
End With
End If
End Sub
I always makes things much harder than they should be... that way later I can slap myself in the forhead after spending hours and hours on two lines of code and say to myself "DUH!"
Sub UndTot2()
Set rTotal = Range("A:A").Find(What:="Grand Total", _
After:=Cells(1, 1), _
LookIn:=xlValues, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not rTotal Is Nothing Then
With Range(rTotal, rTotal.Offset(0, 4))
With .Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
End With
With .Borders(xlEdgeBottom)
.LineStyle = xlDouble
.Weight = xlThick
End With
End With
End If
End Sub
I always makes things much harder than they should be... that way later I can slap myself in the forhead after spending hours and hours on two lines of code and say to myself "DUH!"