Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Combining data from two columns
Assuming names start in A1 and B1, in C1 put this formula and copy
down......... =A1&" "&B1 or =B1&" "&A1 hth Vaya con Dios Chuck, CABGx3 "dziw" wrote: If I have two columns which are lists of names, how do I make a new column which merges the names from each column into one list, and will refresh when new data is added to the two originals. -- dziw ------------------------------------------------------------------------ dziw's Profile: http://www.excelforum.com/member.php...o&userid=10422 View this thread: http://www.excelforum.com/showthread...hreadid=567563 |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Combining data from two columns
Thanks CLR, but I'm not trying to combine each cell together. I'm trying to make a new column (C) which includes each name from two other columns (A & B) and refeshes when A or B is updated with new names. PCLIVE-- How do I use that code? -- dziw ------------------------------------------------------------------------ dziw's Profile: http://www.excelforum.com/member.php...o&userid=10422 View this thread: http://www.excelforum.com/showthread...hreadid=567563 |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Combining data from two columns
Bump for help with the code or other suggestions -- dziw ------------------------------------------------------------------------ dziw's Profile: http://www.excelforum.com/member.php...o&userid=10422 View this thread: http://www.excelforum.com/showthread...hreadid=567563 |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Combining data from two columns
Here's a little mod of PCLIVE's code......
Sub CombineColumns() 'This macro will clear the contents of column C, then 'copy the values from column A to column C, and then 'append the values in column B to the bottom of that list in column C Range("c:c").ClearContents Range("A1:" & Range("A65536").End(xlUp).Address).Select Selection.Copy Range("C1").Select ActiveSheet.Paste Range("B1:" & Range("B65536").End(xlUp).Address).Select Selection.Copy Range("C65536").End(xlUp).Select Selection.Offset(1, 0).Select ActiveSheet.Paste End Sub Vaya con Dios, Chuck, CABGx3 "dziw" wrote: Bump for help with the code or other suggestions -- dziw ------------------------------------------------------------------------ dziw's Profile: http://www.excelforum.com/member.php...o&userid=10422 View this thread: http://www.excelforum.com/showthread...hreadid=567563 |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Combining data from two columns
Thanks alot. It works. I'm not really familiar with coding, so how would I change the references if I'm referring to column A in another worksheet. -- dziw ------------------------------------------------------------------------ dziw's Profile: http://www.excelforum.com/member.php...o&userid=10422 View this thread: http://www.excelforum.com/showthread...hreadid=567563 |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
Combining data from two columns
Add "Worksheets("SheetName")." to the beginning of the Range References
and change "Select" for those ones you want to copy, to "Copy". The modified code below will copy the specified range from the sheet you specify. Please change "SheetName" to the name of the sheet you want to copy from. It then pastes to the active sheet. Give it a try. Sub CombineColumns() 'This macro will clear the contents of column C, then 'copy the values from column A to column C, and then 'append the values in column B to the bottom of that list in column C Range("c:c").ClearContents Worksheets("SheetName").Range("A1:" & Worksheets("SheetName").Range("A65536").End(xlUp). Address).Copy Range("C1").Select ActiveSheet.Paste Worksheets("SheetName").Range("B1:" & Worksheets("SheetName").Range("B65536").End(xlUp). Address).Copy Range("C65536").End(xlUp).Select Selection.Offset(1, 0).Select ActiveSheet.Paste End Sub "dziw" wrote in message ... Thanks alot. It works. I'm not really familiar with coding, so how would I change the references if I'm referring to column A in another worksheet. -- dziw ------------------------------------------------------------------------ dziw's Profile: http://www.excelforum.com/member.php...o&userid=10422 View this thread: http://www.excelforum.com/showthread...hreadid=567563 |
#7
Posted to microsoft.public.excel.misc
|
|||
|
|||
Combining data from two columns
This will get the data from column A on Sheet2 and column B on Sheet3 and
paste it all in column C on sheet1........... Sub CombineColumns() 'This macro will clear the contents of column C, then 'copy the values from column A to column C, and then 'append the values in column B to the bottom of that list in column C Worksheets("sheet1").Select 'The sheet where you want the results Range("c:c").ClearContents Worksheets("sheet2").Select 'The sheet where column A data is Range("A1:" & Range("A65536").End(xlUp).Address).Select Selection.Copy Worksheets("sheet1").Select 'Go back to paste the data Range("C1").Select ActiveSheet.Paste Worksheets("sheet3").Select 'the sheet where column B data is Range("B1:" & Range("B65536").End(xlUp).Address).Select Selection.Copy Worksheets("sheet1").Select 'go back to paste the data Range("C65536").End(xlUp).Select Selection.Offset(1, 0).Select ActiveSheet.Paste Range("c1").Select End Sub hth Vaya con Dios, Chuck, CABGx3 "dziw" wrote: Thanks alot. It works. I'm not really familiar with coding, so how would I change the references if I'm referring to column A in another worksheet. -- dziw ------------------------------------------------------------------------ dziw's Profile: http://www.excelforum.com/member.php...o&userid=10422 View this thread: http://www.excelforum.com/showthread...hreadid=567563 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro question | Excel Worksheet Functions | |||
ranking query | Excel Discussion (Misc queries) | |||
combining 2 columns of data | Excel Discussion (Misc queries) | |||
Inserting a new line when external data changes | Excel Discussion (Misc queries) | |||
Pulling data from 1 sheet to another | Excel Worksheet Functions |