Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi
I guess most things can be done but what I need to know is urgent and I hope someone may be able to assist quickly, I have a speard sheet with a grid listing on it with names like Midlands 1 midlands 2 Southwest 1 and soutwest 2 etc etc What I would like is a quick method of replacing these cells of data with real names. e.g all occurances of Midlands 1 replaced with Fred Smith Midlands 2 replaced with joe brown etc etc rather like mail merge in word. I know I can do simple find and replace but its rather time consuming! Thanks in advance Regards Andy T -- For users by users - BY-users group <http://www.by-users.co.uk |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
One way is to use a helper sheet ..
Assume your source data is within say, A2:K100 in Sheet1 and your lookup list is in Sheet2, cols A and B, viz: Midlands 1 Fred Smith Midlands 2 George K etc In a new sheet, Place in A2: =IF(Sheet1!A2="","",IF(ISNA(VLOOKUP(Sheet1!A2,Shee t2!$A:$B,2,0)),Sheet1!A2,VLOOKUP(Sheet1!A2,Sheet2! $A:$B,2,0))) Copy across/down to K100. This returns the source range in Sheet1 with the replacements that you want done while leaving other source cells "intact". Then just copy A2:K100 & paste special as values to overwrite the source range in Sheet1. Delete away the new sheet. -- Max Singapore http://savefile.com/projects/236895 xdemechanik --- "Andy T" wrote in message ... Hi I guess most things can be done but what I need to know is urgent and I hope someone may be able to assist quickly, I have a speard sheet with a grid listing on it with names like Midlands 1 midlands 2 Southwest 1 and soutwest 2 etc etc What I would like is a quick method of replacing these cells of data with real names. e.g all occurances of Midlands 1 replaced with Fred Smith Midlands 2 replaced with joe brown etc etc rather like mail merge in word. I know I can do simple find and replace but its rather time consuming! Thanks in advance Regards Andy T -- For users by users - BY-users group <http://www.by-users.co.uk |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
You can also use a macro to complete the task. Add other replacement values
to suit. This will replace all instances of each. Sub ChangeToName() Application.ScreenUpdating = False Cells.Replace What:="Midlands 1", Replacement:="Fred Smith", LookAt:= _ xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False Cells.Replace What:="Midlands 2", Replacement:="Joe Brown", LookAt:= _ xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False Cells.Replace What:="Southwest 1", Replacement:="Fred Brown", LookAt:= _ xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False Cells.Replace What:="Southwest 2", Replacement:="Joe Smith", LookAt:= _ xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False Application.ScreenUpdating = True End Sub Regards, Alan "Andy T" wrote in message ... Hi I guess most things can be done but what I need to know is urgent and I hope someone may be able to assist quickly, I have a speard sheet with a grid listing on it with names like Midlands 1 midlands 2 Southwest 1 and soutwest 2 etc etc What I would like is a quick method of replacing these cells of data with real names. e.g all occurances of Midlands 1 replaced with Fred Smith Midlands 2 replaced with joe brown etc etc rather like mail merge in word. I know I can do simple find and replace but its rather time consuming! Thanks in advance Regards Andy T -- For users by users - BY-users group <http://www.by-users.co.uk |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
On Sat, 17 Mar 2007 11:57:59 +0800, "Max"
wrote: One way is to use a helper sheet .. Assume your source data is within say, A2:K100 in Sheet1 and your lookup list is in Sheet2, cols A and B, viz: Midlands 1 Fred Smith Midlands 2 George K etc In a new sheet, Place in A2: =IF(Sheet1!A2="","",IF(ISNA(VLOOKUP(Sheet1!A2,She et2!$A:$B,2,0)),Sheet1!A2,VLOOKUP(Sheet1!A2,Sheet2 !$A:$B,2,0))) Copy across/down to K100. This returns the source range in Sheet1 with the replacements that you want done while leaving other source cells "intact". Then just copy A2:K100 & paste special as values to overwrite the source range in Sheet1. Delete away the new sheet. Thanks mate but that is way above my abilities. I may be able to use it in future now I have something to learn but as I need it for 7am in the morning I guess its easier to do it long hand. Thanks for your time and assistance! Regards Andy T -- For users by users - BY-users group <http://www.by-users.co.uk |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
No problem. But it's really quite simple to set-up and complete. Keep the
steps handy for another time when you might need to do it for a huge source range, say A2:IV65000 <g -- Max Singapore http://savefile.com/projects/236895 xdemechanik --- "Andy T" wrote Thanks mate but that is way above my abilities. I may be able to use it in future now I have something to learn but as I need it for 7am in the morning I guess its easier to do it long hand. Thanks for your time and assistance! Regards Andy T |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Concatenate cells, replacing blanks with cell contents from other rows | Excel Worksheet Functions | |||
Replacing Contents of 1 Cell to Another. | Excel Discussion (Misc queries) | |||
lookup value froma filtered list | Excel Worksheet Functions | |||
how does excel read only odd numbered rows of data froma column? | Excel Worksheet Functions | |||
convert cell contents to different data file format | Excel Worksheet Functions |