Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
MDN MDN is offline
external usenet poster
 
Posts: 3
Default Copying cell contents from many cells and pasting into one cel

Thanks!

"Gord Dibben" wrote:

You could just combine using a formula on destination sheet.

=Sheet1!A1 & Sheet1!B1 and Sheet1!C1 etc.

Or a User Defined Function.......................

Function ConCatRange(CellBlock As Range) As String
Dim Cell As Range
Dim sbuf As String
For Each Cell In CellBlock
If Len(Cell.text) 0 Then sbuf = sbuf & Cell.text & " "
Next
ConCatRange = Left(sbuf, Len(sbuf) - 1)
End Function

=Sheet1!(A1:A10)

Or a macro.............................

Sub ConCat_Cells()
Dim x As Range
Dim y As Range
Dim z As Range
Dim w As String
Dim sbuf As String
On Error GoTo endit
w = InputBox("Enter the Type of De-limiter Desired")
Set z = Application.InputBox("Select Destination Cell", _
"Destination Cell", , , , , , 8)
Application.SendKeys "+{F8}"
Set x = Application.InputBox("Select Cells, Contiguous or Non-Contiguous", _
"Cells Selection", , , , , , 8)
For Each y In x
If Len(y.text) 0 Then sbuf = sbuf & y.text & w
Next
z = Left(sbuf, Len(sbuf) - Len(w))
Exit Sub
endit:
MsgBox "Nothing Selected. Please try again."
End Sub


Gord Dibben MS Excel MVP

On Mon, 10 Dec 2007 11:23:04 -0800, MDN wrote:

Hello

I'd like to copy the contents from a group of cells and then paste all of
those contents into one cell on a different worksheet. How can I do this?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
prevent changes to cell references when copying and pasting MiChaos Excel Discussion (Misc queries) 2 July 3rd 07 04:21 PM
Copying and pasting table info and cell formating in one hit Sam at JWP Excel Discussion (Misc queries) 3 April 19th 07 03:24 AM
Copying and Pasting a cell with a constant number DenDz Excel Worksheet Functions 2 May 31st 06 07:57 PM
Copying format to a new cell, w/o overwriting destination cell contents James C Excel Discussion (Misc queries) 1 October 18th 05 08:02 PM
If Statement and copying all of cell contents. andrewm Excel Worksheet Functions 0 June 29th 05 04:37 AM


All times are GMT +1. The time now is 08:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"