Hi, I'm trying to Trim visible cells after a filter is applied. It all works except for the result.
Current Cell Value: "11 05 18 09:06:50: closed by linker #MIT # Updates were made well before SLA expired"
Result Required Cell Value: "#MIT # Updates were made well before SLA expired"
Result with Present Code: "MIT"
Current Cell Value: "11 05 18 09:06:50: closed by linker #MIT # Updates were made well before SLA expired"
Result Required Cell Value: "#MIT # Updates were made well before SLA expired"
Result with Present Code: "MIT"
Code:
Sub Step9a()
ActiveSheet.Range("$A$1:$BG$204").AutoFilter Field:=31, Criteria1:="<>#*", _
Operator:=xlAnd
Range("AE1").Offset(1, 0).Select
Range(Selection, Selection.End(xlDown)).SpecialCells(xlCellTypeVisible).Select
Dim c As Range
For Each c In Selection
If c.Value <> "" Then c.Value = Trim(Split(c, "#")(1))
Next
ActiveSheet.ShowAllData
SendKeys "{ESC}"
End Sub
Last edited: