G
Gwen
I want to format the "total columns.
I would like this code to look for the rows that has "total.
When found is true format columns "f:m"
Logic: For each row that has the word "total" then format columns f:m
When I used this code to delete rows it worked perfectly, so there must be
something wrong with these lines:
with rng(i, "f:m")
.font.bold = true
.Borders (xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.Rows.ColorIndex = xlAutomatic
end with
Dim myArr As Variant
Dim Rng As Range
Dim I As Long
Application.ScreenUpdating = False
myArr = Array("total")
For I = LBound(myArr) To UBound(myArr)
Do
Set Rng = Range("c:c").Find(What:=myArr(I), _
After:=Range("c" & Rows.Count), _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not Rng Is Nothing Then
with rng(i, "f:m")
.font.bold = true
.Borders (xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.Rows.ColorIndex = xlAutomatic
end with
'Rng.EntireRow.Delete
Loop While Not (Rng Is Nothing)
Next I
Application.ScreenUpdating = True
Thanks
I would like this code to look for the rows that has "total.
When found is true format columns "f:m"
Logic: For each row that has the word "total" then format columns f:m
When I used this code to delete rows it worked perfectly, so there must be
something wrong with these lines:
with rng(i, "f:m")
.font.bold = true
.Borders (xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.Rows.ColorIndex = xlAutomatic
end with
Dim myArr As Variant
Dim Rng As Range
Dim I As Long
Application.ScreenUpdating = False
myArr = Array("total")
For I = LBound(myArr) To UBound(myArr)
Do
Set Rng = Range("c:c").Find(What:=myArr(I), _
After:=Range("c" & Rows.Count), _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not Rng Is Nothing Then
with rng(i, "f:m")
.font.bold = true
.Borders (xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.Rows.ColorIndex = xlAutomatic
end with
'Rng.EntireRow.Delete
Loop While Not (Rng Is Nothing)
Next I
Application.ScreenUpdating = True
Thanks