Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default Consolidate multiple cells into one

How would I consolidate multiple cells(more than two) into one cell. I used
concatenate but would like to be able to select all applicable cells at once
instead of keying in each cell number.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Consolidate multiple cells into one

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) - 1)
Exit Sub
endit:
MsgBox "Nothing Selected. Please try again."
End Sub

If not familiar with VBA and macros, see David McRitchie's site for more on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

First...create a backup copy of your original workbook.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + r to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the code in there. Save the
workbook and hit ALT + Q to return to your workbook.

Run or edit the macro by going to ToolMacroMacros.

You can also assign this macro to a button or a shortcut key combo.


Gord Dibben MS Excel MVP

On Thu, 16 Aug 2007 18:04:36 -0700, stetka
wrote:

How would I consolidate multiple cells(more than two) into one cell. I used
concatenate but would like to be able to select all applicable cells at once
instead of keying in each cell number.


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
How to consolidate multiple worksheets into one. Bovine Jones Excel Discussion (Misc queries) 16 February 20th 09 10:45 PM
Consolidate data from multiple sheets Bdavis Excel Worksheet Functions 0 September 26th 06 04:25 PM
Consolidate multiple workbooks BillMarshall Excel Worksheet Functions 2 November 26th 05 09:40 AM
How to consolidate data from multiple worksheets. SAR Excel Worksheet Functions 0 August 28th 05 12:56 PM
Consolidate list from multiple worksheets VT Excel Worksheet Functions 0 November 24th 04 04:51 PM


All times are GMT +1. The time now is 04:53 AM.

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"