Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default two word last names

I am importing data delimited, with tab and space selected if counta = 12
then everything is fine if counta = 13 then I have people with two word last
names. When this is the case how would I programmatically combine the names
in columns c, d to reflect this?
Thank you in advance.

db


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default two word last names

If I am understanding you, I think you can do this with a formula
If C1 = Abdul
and D1 = Jabar
in cell E1, enter =C1&"-"&D1
E1's value will be "Abdul-Jabar"
Then just copy and paste as values.
(The "-" is to hyphenate the name.)

Does this help?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default two word last names

Hi David,
If I am guessing correctly you want to combine Column B & C
together if there is a value in Column M (col 13), and then
delete the cell in Column C in such rows shifting the remaining
cells left. Suggest you try this on a copy of your worksheet.

Sub Combine_BandC_if_M_notempty()
'David McRitchie, 2005-03-08 programming
'assumes since this came from elsewhere that Column M
' is either empty or has a constant (not a formula)
' an empty string i.e. single quote would not be empty
Dim cell As Range, rng As Range, i As Long
On Error Resume Next
Set rng = Range("M:M").SpecialCells(xlConstants)
If rng Is Nothing Then Exit Sub
On Error GoTo 0
For Each cell In rng
Cells(cell.row, 2) = ActiveSheet.Cells(cell.row, 2) _
& " " & Cells(cell.row, 3)
Cells(cell.row, 3).Delete Shift:=xlToLeft
Next cell
End Sub
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"David Bateman" wrote in message ...
I am importing data delimited, with tab and space selected if counta = 12
then everything is fine if counta = 13 then I have people with two word last
names. When this is the case how would I programmatically combine the names
in columns c, d to reflect this?
Thank you in advance.

db




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
converting email address names in a range of cells to real names John Excel Worksheet Functions 1 May 19th 10 03:44 PM
Trying to merge from excel to word. New names won't merge ruth tozer Excel Worksheet Functions 0 June 27th 07 05:58 AM
How do I create a list (Word) of the names on Excel worksheet tabs PT[_2_] Excel Worksheet Functions 3 February 23rd 07 05:24 PM
Importing Microsoft Word File Names jrwaguespack Excel Worksheet Functions 3 March 16th 05 07:41 AM
Change names of files in a folder to match names in Excel Column saybut Excel Programming 4 February 9th 04 06:26 PM


All times are GMT +1. The time now is 07:25 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"