Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Extracting Words from Cells
I would like to extract the last names from a group of cells
containing a first and last name and place them into a separate column. Is there an easier way to accomplish this other than highlghting the last name and using cut&paste to move into the new cell? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Extracting Words from Cells
If each cell is only two names (first & last, no "Jr.", etc.) it's
pretty easy. Dim c As Range Dim rng As Range Dim iPos As Integer 'change next line to suit Set rng = Sheets("Sheet1").Range("A1:A10") For Each c In rng iPos = InStr(c, " ") 'extract last name and put in col B c.Offset(0, 1) = Right(c, Len(c) - iPos) Next c Hth, Merjet |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Extracting Words from Cells
If the first and last names are separated by a space and/or a comma, then
consider using Text to Columns -- Gary''s Student gsnu200706 "Tommy" wrote: I would like to extract the last names from a group of cells containing a first and last name and place them into a separate column. Is there an easier way to accomplish this other than highlghting the last name and using cut&paste to move into the new cell? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Extracting cells from worksheet based on value of 2 cells | Excel Worksheet Functions | |||
Extracting parts of a cell when only certain words appear | Excel Discussion (Misc queries) | |||
Extracting the last set of words from a text string | Excel Worksheet Functions | |||
Separating / extracting words within a cell | Excel Programming | |||
Extracting just the color words | Excel Worksheet Functions |