I've got a worksheet that pulls a lot of data together from the rest of the workbook. My code then runs a 'for each' loop to remove any spaces in the data. The problem is i've got 60 instances of this code to run. From named ranges A1 to A60. My question is can i speed this section of the code up by using arrays? If i'm given pointers with this instance i can apply it to the other instances. I've no experience with arrays hence my need for help.
2 Answers
I'd look into:
A1.Value = Application.Substitute(A1, " ", "")
Or:
A1.Replace what:=" ", Replacement:="", Lookat:=xlPart
Note that you can add more of the parameters of Range.Replace() to avoid any possible mishaps since this function will save and use settings of previous attempts using this function.
