Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need to combine first and last name from two columns
This is what I have. I need some help as indicated in the comments:
Sub Combine() Do ' Outer loop. ActiveCell.Select last = ActiveCell.Formula 'need to move one cell to the right here ActiveCell.Select first = ActiveCell.Formula 'need to move one cell to the right here ActiveCell.FormulaR1C1 = last + ", " + first ' need to move back to column one here ' need to move down one row here Loop Until EOF 'Will this stop at the first empty value in column one? End Sub Thank you in advance. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need to combine first and last name from two columns
Dave,
Sub testit() Dim i As Long, lngLastRow As Long With Sheet1 lngLastRow = .Cells(1, 1).End(xlDown).Row For i = 1 To lngLastRow .Cells(i, 3) = .Cells(i, 1) & ", " & .Cells(i, 2) Next End With End Sub Rob "Dave" wrote in message ... This is what I have. I need some help as indicated in the comments: Sub Combine() Do ' Outer loop. ActiveCell.Select last = ActiveCell.Formula 'need to move one cell to the right here ActiveCell.Select first = ActiveCell.Formula 'need to move one cell to the right here ActiveCell.FormulaR1C1 = last + ", " + first ' need to move back to column one here ' need to move down one row here Loop Until EOF 'Will this stop at the first empty value in column one? End Sub Thank you in advance. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need to combine first and last name from two columns
Rob,
Nice, worked great. Thanks again, Dave "Rob van Gelder" wrote in message ... Dave, Sub testit() Dim i As Long, lngLastRow As Long With Sheet1 lngLastRow = .Cells(1, 1).End(xlDown).Row For i = 1 To lngLastRow .Cells(i, 3) = .Cells(i, 1) & ", " & .Cells(i, 2) Next End With End Sub Rob "Dave" wrote in message ... This is what I have. I need some help as indicated in the comments: Sub Combine() Do ' Outer loop. ActiveCell.Select last = ActiveCell.Formula 'need to move one cell to the right here ActiveCell.Select first = ActiveCell.Formula 'need to move one cell to the right here ActiveCell.FormulaR1C1 = last + ", " + first ' need to move back to column one here ' need to move down one row here Loop Until EOF 'Will this stop at the first empty value in column one? End Sub Thank you in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Combine multiple columns into two long columns, Repeating rows in first column | Excel Discussion (Misc queries) | |||
Combine columns | Excel Discussion (Misc queries) | |||
Combine multiple columns into two long columns, Repeating rows in first column | Excel Discussion (Misc queries) | |||
combine 2 columns | Excel Worksheet Functions | |||
How to combine two columns? | Excel Worksheet Functions |