Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 29
Default Copy and Paste function

Good day!

I need a formula that I can use to take values in one row but different
columns and merge them together into one line with the pipe symbol (|)
separating the column values, for example:

Column:
A B C D E F

100 141 154 160 175 182

Becomes
Column
A B C D E F
100|141|154|160|175|185

I have been using the "&" function, but I can't seem to get the formula right.

--
Thanks for your help!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Copy and Paste function

=CONCATENATE(A1,"|",B1,"|",C1,"|",D1,"|",E1,"|",F1 )

"TamIam" wrote:

Good day!

I need a formula that I can use to take values in one row but different
columns and merge them together into one line with the pipe symbol (|)
separating the column values, for example:

Column:
A B C D E F

100 141 154 160 175 182

Becomes
Column
A B C D E F
100|141|154|160|175|185

I have been using the "&" function, but I can't seem to get the formula right.

--
Thanks for your help!

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 29
Default Copy and Paste function

Thank you - is there anyway I can do this without typing the individual cell
addresses? Perhaps by autofilling a command that you know of?
--
Thanks for your help!


"Teethless mama" wrote:

=CONCATENATE(A1,"|",B1,"|",C1,"|",D1,"|",E1,"|",F1 )

"TamIam" wrote:

Good day!

I need a formula that I can use to take values in one row but different
columns and merge them together into one line with the pipe symbol (|)
separating the column values, for example:

Column:
A B C D E F

100 141 154 160 175 182

Becomes
Column
A B C D E F
100|141|154|160|175|185

I have been using the "&" function, but I can't seem to get the formula right.

--
Thanks for your help!

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Copy and Paste function

You can use this UDF which ignores blank cells in the selected range.

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

Usage is: =concatrange(A1:F32)

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

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

or Ron de De Bruin's site on where to store macros.

http://www.rondebruin.nl/code.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.

In a cell enter the formula as shown above in Usage is:


Gord Dibben MS Excel MVP

On Mon, 14 Apr 2008 06:03:02 -0700, TamIam
wrote:

Thank you - is there anyway I can do this without typing the individual cell
addresses? Perhaps by autofilling a command that you know of?


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
Copy & Paste value Function Dinesh Excel Worksheet Functions 5 July 27th 06 08:52 PM
disabling the copy paste function in a cell sam Excel Worksheet Functions 0 February 22nd 06 02:10 PM
cut,copy paste function TUNGANA KURMA RAJU Excel Discussion (Misc queries) 0 December 9th 05 07:21 AM
prevent the copy and paste function sir Lancelot Excel Discussion (Misc queries) 1 December 8th 05 01:16 AM
Control function for copy/paste Vicky Excel Worksheet Functions 0 August 19th 05 02:00 PM


All times are GMT +1. The time now is 07:23 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"