I recently read the following article on using find and replace to correct typos in city names based on a list of corrections Find and Replace based on a List
I was wondering if the same principals couple be applied for a large scale anonymisation of a dataset replacing peoples names such as "Toby" or "Mr Jones" with "name" or "Mr name" without having to write an extremely long macro code below and mannually inserting every different name in to the What:="" section
This would be in medical record data so the cell might contain a long string sentence like "I told toby to go to the pharmacy" and wanting the end product to be "I told name to go to the pharmacy"
Because there are thousands of different possible names it's not really feasible to do the above code for every name but a list is much more viable and seemed to be potentially possible based on the previous post. This list would need to be edited to include spaces before / after the name e.g. " Ali " as these three ordered letters could appear in multiple other words.
So hoping for find and replace worksheet that would have a list of names in column A e.g.
" Ali "
" Ali, "
" Ben "
" Steve "
all to be replace with "name" which could be inserted into every cell in column B unless there is an easier way to do it?
Thanks very much for any help / advice!
BW
Pete
I was wondering if the same principals couple be applied for a large scale anonymisation of a dataset replacing peoples names such as "Toby" or "Mr Jones" with "name" or "Mr name" without having to write an extremely long macro code below and mannually inserting every different name in to the What:="" section
Selection.Replace What:="toby", Replacement:="name", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False, FormulaVersion:=xlReplaceFormula2
This would be in medical record data so the cell might contain a long string sentence like "I told toby to go to the pharmacy" and wanting the end product to be "I told name to go to the pharmacy"
Because there are thousands of different possible names it's not really feasible to do the above code for every name but a list is much more viable and seemed to be potentially possible based on the previous post. This list would need to be edited to include spaces before / after the name e.g. " Ali " as these three ordered letters could appear in multiple other words.
So hoping for find and replace worksheet that would have a list of names in column A e.g.
" Ali "
" Ali, "
" Ben "
" Steve "
all to be replace with "name" which could be inserted into every cell in column B unless there is an easier way to do it?
Thanks very much for any help / advice!
BW
Pete