'Excel macro to insert certain characters into column
Im currently using this. while this works for now. Im looking to add code that allows me replace everything in that column. Not just limited to only replacing the 0 or one word.
.AutoFilter field:=6, Criteria1:="0"
Columns("F").replace What:="0", Replacement:="Not Needed", Lookat:=xlPart, searchOrder:=xlByRows, MatchCase:=False, Searchformat:=False, ReplaceFormat:=False
Worksheets("Sheet1").AutoFilterMode = False
Solution 1:[1]
Sub test()
Dim rg As Range
With ActiveSheet
Set rg = .Range("A1", .Range("C" & Rows.Count).End(xlUp)) 'change as needed
With rg
.AutoFilter Field:=3, Criteria1:="=0", Operator:=xlAnd 'change as needed
.Resize(.Rows.Count - 1, .Columns.Count).Offset(1, 0).SpecialCells(xlCellTypeVisible).Value = "X"
.AutoFilter
End With
End With
End Sub
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |