G
Guest
Simple question(I think) - from a newbie
Ok, I have looked through here and I know cleaning up names is difficult. The thing is I have all the formulas I need to do it, and for my data it works every time. I was just wondering if there was a way to put them into a macro so that I don't have to use so many columns and cut and paste. Here is how everything is layed out.
Column "A" - Names
Column "B" - =TRIM(A2)
Column "C" - =IF(ISERROR(FIND(" ",A2,1)),A2,LEFT(A2,FIND(" ",A2,1)-1))
Column "D" - =IF(ISERROR(FIND(" ",A2,FIND(" ",A2)+1)),RIGHT(A2,LEN(A2)-FIND(" ",A2)),RIGHT(A2,LEN(A2)-FIND_
(" ",A2,FIND(" ",A2)+1)-0))
Column "E" - =CONCATENATE(D2," ",C2)
Then I copy and paste the values from "E" back into "A"
So I take raw names that have extra spaces and middle initials - I seperate ou tand get first and last names and then concatnate them together. What I am wondering is if I can use a macro that can do all of this in place so that I don't have to use so many columns and copy and paste these formulas. Since I don't know how many names are in each file I need it to do it all the way down column "A" untill the cell is blank.
I am sure this is simple, but my knowledge of macros doesn't go much past recording them.
If anybody can show me how to do something like this it would be greatly appreciated, as it would save me alot of time since I have to repeat this process on many workbooks.
Thanks for your time,
Emily Suskovich
Ok, I have looked through here and I know cleaning up names is difficult. The thing is I have all the formulas I need to do it, and for my data it works every time. I was just wondering if there was a way to put them into a macro so that I don't have to use so many columns and cut and paste. Here is how everything is layed out.
Column "A" - Names
Column "B" - =TRIM(A2)
Column "C" - =IF(ISERROR(FIND(" ",A2,1)),A2,LEFT(A2,FIND(" ",A2,1)-1))
Column "D" - =IF(ISERROR(FIND(" ",A2,FIND(" ",A2)+1)),RIGHT(A2,LEN(A2)-FIND(" ",A2)),RIGHT(A2,LEN(A2)-FIND_
(" ",A2,FIND(" ",A2)+1)-0))
Column "E" - =CONCATENATE(D2," ",C2)
Then I copy and paste the values from "E" back into "A"
So I take raw names that have extra spaces and middle initials - I seperate ou tand get first and last names and then concatnate them together. What I am wondering is if I can use a macro that can do all of this in place so that I don't have to use so many columns and copy and paste these formulas. Since I don't know how many names are in each file I need it to do it all the way down column "A" untill the cell is blank.
I am sure this is simple, but my knowledge of macros doesn't go much past recording them.
If anybody can show me how to do something like this it would be greatly appreciated, as it would save me alot of time since I have to repeat this process on many workbooks.
Thanks for your time,
Emily Suskovich