Make copy from a serial cells to one cell

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
I need to copy the value from groups of cells manually to one cell as the source cells don't have a consistent pattern, using & wouldn't save me much time.

Example :
Source
A1 345-678
A14 564-234
A67 453-098

Destination
H78. 345-678
564-234
453-098

I will use alt+enter to separate them to different line in H78. I can use filter to get the source with same type source then make copy. This is a mapping job for a report setting, seems no shortcut i will have but using filter and my eye to collect the source. I got many of these to copy, so just want to ask for help if there is a faster way to do the copy job. thanks for your help.

Et
 
Upvote 0
You could use a simple macro and activate it from a keypress (eg Ctrl+q):

Code:
Sub Concat_Cells()
Dim c As Range, temp As Variant

On Error Resume Next

For Each c In Application.InputBox("Select your cells",Type:=8).Cells
  temp = temp & Chr$(10) & c.Value
Next c

ActiveCell = Mid$(temp,2)

End Sub

If you place this in a module in your workbook (via Alt+F11 to open the VBE and then Alt+I+M to insert a module - paste in here), then go back into Excel and in 2007 or 2010 * Developer tab>Macros>Select Concat_Cells from the list and hit Options to assign a shortcut key (eg Ctrl+q). Now to activate you just need to select the cell where you want the concatenated data to go and hit Ctrl+q to activate a dialog where you can select the cells (hold down Ctrl so all cells selected) you want, hit OK and the results will be placed in the cell.

* in 2003 or earlier it is in Tools>Macros
 
Upvote 0
You could use a simple macro and activate it from a keypress (eg Ctrl+q):

Code:
Sub Concat_Cells()
Dim c As Range, temp As Variant

On Error Resume Next

For Each c In Application.InputBox("Select your cells",Type:=8).Cells
  temp = temp & Chr$(10) & c.Value
Next c

ActiveCell = Mid$(temp,2)

End Sub

If you place this in a module in your workbook (via Alt+F11 to open the VBE and then Alt+I+M to insert a module - paste in here), then go back into Excel and in 2007 or 2010 * Developer tab>Macros>Select Concat_Cells from the list and hit Options to assign a shortcut key (eg Ctrl+q). Now to activate you just need to select the cell where you want the concatenated data to go and hit Ctrl+q to activate a dialog where you can select the cells (hold down Ctrl so all cells selected) you want, hit OK and the results will be placed in the cell.

* in 2003 or earlier it is in Tools>Macros
Richard, Thank you so much for your help. I am now not at my computer will try it later.
 
Upvote 0

Forum statistics

Threads
1,224,591
Messages
6,179,766
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top