Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
combine titles/names - how? Martin ©æ©¬ @nohere.net Excel Discussion (Misc queries) 7 March 22nd 10 01:47 PM
Combine cells with the same reference and combine quantities brandon Excel Discussion (Misc queries) 2 September 17th 08 05:44 PM
How can I combine cells with first/last names into email addy? Patrick Excel Worksheet Functions 9 August 18th 06 06:41 PM
Combine several Names in one folder with if-formula Vic1978 Excel Discussion (Misc queries) 4 December 7th 05 12:38 PM
how do I combine cells (names) fiji41 Excel Discussion (Misc queries) 2 June 16th 05 12:19 AM


All times are GMT +1. The time now is 08:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"