Etphonehome
New Member
- Joined
- Apr 9, 2011
- Messages
- 18
Is there a way that can copy a serial cells value to one cell ?
Thanks
Et
Thanks
Et
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
Richard, Thank you so much for your help. I am now not at my computer will try it later.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, thanks so much for the help. I am now not with my computer, will try it later.Richard, Thank you so much for your help. I am now not at my computer will try it later.