Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
last name first, first name last -- is there a code to combine 2 cells with last and first names?
Thanks again for all your help. This group has been quite valuable to
me. There are a couple of things I would like to do here. First, I have two columns of data. Col B is last names, Col C is first names. I would like to combine all that data into Col B with the Last Name First, (comma space) then First Name. Is there a quick macro I can write to do that? Then, after the data is in that format, is there a way to reverse column B so that the data is First Name First (space) Last Name (no comma)? That would be the best. I need the data both ways at different times depending on what I'm doing. Thanks again in advance for the advice. JasonK |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
last name first, first name last -- is there a code to combine 2 c
If you need both formats, why don'tyou use two helper columns, say D with
formula =B2&", "&C2 and E with formula =C2&" "&B2 filled down as necessary? Regards, Stefi €˛JasonK€¯ ezt Ć*rta: Thanks again for all your help. This group has been quite valuable to me. There are a couple of things I would like to do here. First, I have two columns of data. Col B is last names, Col C is first names. I would like to combine all that data into Col B with the Last Name First, (comma space) then First Name. Is there a quick macro I can write to do that? Then, after the data is in that format, is there a way to reverse column B so that the data is First Name First (space) Last Name (no comma)? That would be the best. I need the data both ways at different times depending on what I'm doing. Thanks again in advance for the advice. JasonK |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
last name first, first name last -- is there a code to combine 2 c
because of other macros that run, i need the data to stay in that
column. i just need it last name, first name sometimes and first name last name others. is there a way to do it? thanks again JasonK On Fri, 17 Jul 2009 00:09:01 -0700, Stefi wrote: If you need both formats, why don'tyou use two helper columns, say D with formula =B2&", "&C2 and E with formula =C2&" "&B2 filled down as necessary? Regards, Stefi „JasonK” ezt ķrta: Thanks again for all your help. This group has been quite valuable to me. There are a couple of things I would like to do here. First, I have two columns of data. Col B is last names, Col C is first names. I would like to combine all that data into Col B with the Last Name First, (comma space) then First Name. Is there a quick macro I can write to do that? Then, after the data is in that format, is there a way to reverse column B so that the data is First Name First (space) Last Name (no comma)? That would be the best. I need the data both ways at different times depending on what I'm doing. Thanks again in advance for the advice. JasonK |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
last name first, first name last -- is there a code to combine
If you run such a macro, it'll overwrite last names in column B. Do you want
to restore the original content (last names only) of column B? Stefi €˛JasonK€¯ ezt Ć*rta: because of other macros that run, i need the data to stay in that column. i just need it last name, first name sometimes and first name last name others. is there a way to do it? thanks again JasonK On Fri, 17 Jul 2009 00:09:01 -0700, Stefi wrote: If you need both formats, why don'tyou use two helper columns, say D with formula =B2&", "&C2 and E with formula =C2&" "&B2 filled down as necessary? Regards, Stefi €˛JasonK€¯ ezt Ć*rta: Thanks again for all your help. This group has been quite valuable to me. There are a couple of things I would like to do here. First, I have two columns of data. Col B is last names, Col C is first names. I would like to combine all that data into Col B with the Last Name First, (comma space) then First Name. Is there a quick macro I can write to do that? Then, after the data is in that format, is there a way to reverse column B so that the data is First Name First (space) Last Name (no comma)? That would be the best. I need the data both ways at different times depending on what I'm doing. Thanks again in advance for the advice. JasonK |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
last name first, first name last -- is there a code to combine 2 cells with last and first names?
so B will be LstName, FirstName
Option Explicit Sub CreateFullNames() Dim source As Range Set source = Range("B2") Do Until source = "" source.Value = source.Value & ", " & source.Offset(, 1).Value Set source = source.Offset(1) Loop End Sub Sub SetCtoFirstName() Dim lastrow As Long lastrow = Range("B2").End(xlDown).Row Range(Range("C2"), Cells(lastrow, "C")).FormulaR1C1 = _ "=MID(RC2,FIND("","",RC2)+2,99)" End Sub Sub SetCtoLastName() Dim lastrow As Long lastrow = Range("B2").End(xlDown).Row Range(Range("C2"), Cells(lastrow, "C")).FormulaR1C1 = _ "=LEFT(RC2,FIND("","",RC2)-1)" End Sub "JasonK" wrote in message ... Thanks again for all your help. This group has been quite valuable to me. There are a couple of things I would like to do here. First, I have two columns of data. Col B is last names, Col C is first names. I would like to combine all that data into Col B with the Last Name First, (comma space) then First Name. Is there a quick macro I can write to do that? Then, after the data is in that format, is there a way to reverse column B so that the data is First Name First (space) Last Name (no comma)? That would be the best. I need the data both ways at different times depending on what I'm doing. Thanks again in advance for the advice. JasonK |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
last name first, first name last -- is there a code to combine 2 cells with last and first names?
.... so run CreateFullNames ONCE to merge B and C into B
then run SetCtoFirstName or SetCtoLastName ant anytime --- these just split out the first or last name into C as you need "Patrick Molloy" wrote in message ... so B will be LstName, FirstName Option Explicit Sub CreateFullNames() Dim source As Range Set source = Range("B2") Do Until source = "" source.Value = source.Value & ", " & source.Offset(, 1).Value Set source = source.Offset(1) Loop End Sub Sub SetCtoFirstName() Dim lastrow As Long lastrow = Range("B2").End(xlDown).Row Range(Range("C2"), Cells(lastrow, "C")).FormulaR1C1 = _ "=MID(RC2,FIND("","",RC2)+2,99)" End Sub Sub SetCtoLastName() Dim lastrow As Long lastrow = Range("B2").End(xlDown).Row Range(Range("C2"), Cells(lastrow, "C")).FormulaR1C1 = _ "=LEFT(RC2,FIND("","",RC2)-1)" End Sub "JasonK" wrote in message ... Thanks again for all your help. This group has been quite valuable to me. There are a couple of things I would like to do here. First, I have two columns of data. Col B is last names, Col C is first names. I would like to combine all that data into Col B with the Last Name First, (comma space) then First Name. Is there a quick macro I can write to do that? Then, after the data is in that format, is there a way to reverse column B so that the data is First Name First (space) Last Name (no comma)? That would be the best. I need the data both ways at different times depending on what I'm doing. Thanks again in advance for the advice. JasonK |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
last name first, first name last -- is there a code to combine 2 cells with last and first names?
Thank you Patrick. I will copy these and run them.
Thanks again for your help. JasonK On Fri, 17 Jul 2009 12:40:42 +0100, "Patrick Molloy" wrote: ... so run CreateFullNames ONCE to merge B and C into B then run SetCtoFirstName or SetCtoLastName ant anytime --- these just split out the first or last name into C as you need "Patrick Molloy" wrote in message ... so B will be LstName, FirstName Option Explicit Sub CreateFullNames() Dim source As Range Set source = Range("B2") Do Until source = "" source.Value = source.Value & ", " & source.Offset(, 1).Value Set source = source.Offset(1) Loop End Sub Sub SetCtoFirstName() Dim lastrow As Long lastrow = Range("B2").End(xlDown).Row Range(Range("C2"), Cells(lastrow, "C")).FormulaR1C1 = _ "=MID(RC2,FIND("","",RC2)+2,99)" End Sub Sub SetCtoLastName() Dim lastrow As Long lastrow = Range("B2").End(xlDown).Row Range(Range("C2"), Cells(lastrow, "C")).FormulaR1C1 = _ "=LEFT(RC2,FIND("","",RC2)-1)" End Sub "JasonK" wrote in message ... Thanks again for all your help. This group has been quite valuable to me. There are a couple of things I would like to do here. First, I have two columns of data. Col B is last names, Col C is first names. I would like to combine all that data into Col B with the Last Name First, (comma space) then First Name. Is there a quick macro I can write to do that? Then, after the data is in that format, is there a way to reverse column B so that the data is First Name First (space) Last Name (no comma)? That would be the best. I need the data both ways at different times depending on what I'm doing. Thanks again in advance for the advice. JasonK |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
combine titles/names - how? | Excel Discussion (Misc queries) | |||
Combine cells with the same reference and combine quantities | Excel Discussion (Misc queries) | |||
How can I combine cells with first/last names into email addy? | Excel Worksheet Functions | |||
Combine several Names in one folder with if-formula | Excel Discussion (Misc queries) | |||
how do I combine cells (names) | Excel Discussion (Misc queries) |