I have two columns with data. Each cell is formatted: "***" or "XXX at mm.dd.yyyy", where XXX represent various numeric combinations, and I need to replace "XXX at mm.dd.yyyy" with "XXX", so I've done this:
For Each c In Range(.Cells(2, 9), .Cells(finalrow, 10))
If c <> "***" Then
c.Value = Split(c, " at")(0) * 1
End If
Next c
but I get a 'Subscript out of range' error on the row 2345.
What am I missing here?
"***"format but doesn't haveatdelimitier. The problem is that that array you create doesn't have any items at all. Temporary fix is to add conditionIf Ubound(Split(c, " at") >=0 Then