I have this macro that removed certain parts of the text if the number of characters in any cell in column K is longer than 40.
However, it is also adding a 0 to any cell in K when the number of characters is 0. See picture below
code also below. Any help is greatly appreciated
However, it is also adding a 0 to any cell in K when the number of characters is 0. See picture below
code also below. Any help is greatly appreciated
VBA Code:
Sub CleanUpStringsLongerThanForty()
With Range("K2", Range("K" & Rows.Count).End(xlUp))
.Value = Evaluate(Replace("if(len(#)>40,substitute(substitute(substitute(#,""(San)"",""""),""(WET)"",""""),""COVER"",""""),#)", "#", .Address))
End With
End Sub