Hi all,
First time poster here, very much a VBA novice- hoping you can help me out!
I have a sheet of 64227 lines. I've used a substitute formula to get down to a list of categories in column J.
Because of the substitute formula, each cell contains duplicate values: eg category one, category 1, category 1, category 2.
I need these cells to just display "category one, category two".
I've been manually finding and replacing but the scale of the sheet is making this unmanageable.
So I've created a find and replace macro using this formula:
Sub ReplaceText()
Dim myList, myRange
Set myList = Sheets("Sheet1").Range("A2:B332")
Set myRange = Sheets("Client").Range("J2:J64227")
For Each cel In myList.Columns(1).Cells
myRange.Replace What:=cel.Value, Replacement:=cel.Offset(0, 1).Value, LookAt:=xlWhole
Next cel
End Sub
But when I click "Run Macro" it converts some values, but not others.
Debugger points to this line : myRange.Replace What:=cel.Value, Replacement:=cel.Offset(0, 1).Value, LookAt:=xlWhole
But I can't work out what's causing the problem there.
I've googled for hours, can anyone shed light on this for me?
Thanks!
Bookmarks