tanyaleblanc
Board Regular
- Joined
- Mar 16, 2019
- Messages
- 145
I'm trying to change the word No to Yes in column M I have headings in row 2, so anything after that to the last cell in column M I want to change to Yes, but I'm getting an error.
Sub Filter()
Dim lRow As Long
Dim fnd As Variant
Dim rplc As Variant
fnd = "No"
rplc = "Yes"
If AutoFilterMode = True And FilterMode = True Then ActiveSheet.ShowAllData
lRow = ActiveSheet.Range("A8500").End(xlUp).Row
With ActiveSheet
.AutoFilterMode = False
With Range("a1:ah" & lRow)
.AutoFilter
.AutoFilter field:=2, Criteria1:="#N/A"
.AutoFilter field:=14, Criteria1:="="
.AutoFilter field:=16, Criteria1:="="
.AutoFilter field:=17, Criteria1:="="
.AutoFilter field:=18, Criteria1:="="
.AutoFilter field:=19, Criteria1:="="
.AutoFilter field:=13, Criteria1:="<>Yes"
'trying to find and replace no with yes in column m
Range("m3") = "Yes": Range("m3:m" & lastrow).FillDown
End With
End With
End Sub
Sub Filter()
Dim lRow As Long
Dim fnd As Variant
Dim rplc As Variant
fnd = "No"
rplc = "Yes"
If AutoFilterMode = True And FilterMode = True Then ActiveSheet.ShowAllData
lRow = ActiveSheet.Range("A8500").End(xlUp).Row
With ActiveSheet
.AutoFilterMode = False
With Range("a1:ah" & lRow)
.AutoFilter
.AutoFilter field:=2, Criteria1:="#N/A"
.AutoFilter field:=14, Criteria1:="="
.AutoFilter field:=16, Criteria1:="="
.AutoFilter field:=17, Criteria1:="="
.AutoFilter field:=18, Criteria1:="="
.AutoFilter field:=19, Criteria1:="="
.AutoFilter field:=13, Criteria1:="<>Yes"
'trying to find and replace no with yes in column m
Range("m3") = "Yes": Range("m3:m" & lastrow).FillDown
End With
End With
End Sub