Copying several cells in one

huorsa

Board Regular
Joined
Feb 15, 2002
Messages
101
I want to know how can I put several cells into one cell. Let's say that in A1 I have "Name", A2 "Address", A3 "Phone"; I want to have in cell A4 "Name"|"Address"|"Phone"| (I want to have the three cells together separated by the pipe symbol (|).

Hugo
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
On 2002-02-17 20:20, huorsa wrote:
I want to know how can I put several cells into one cell. Let's say that in A1 I have "Name", A2 "Address", A3 "Phone"; I want to have in cell A4 "Name"|"Address"|"Phone"| (I want to have the three cells together separated by the pipe symbol (|).

Hugo

Hugo, you can do this via formula. This will do it:
=A1&"|"&A2&"|"&A3

Are you looking to do it in VBA?


_________________

Barrie Davidson
My Excel Web Page
This message was edited by Barrie Davidson on 2002-02-17 20:28
 
Upvote 0
On 2002-02-17 20:20, huorsa wrote:
I want to know how can I put several cells into one cell. Let's say that in A1 I have "Name", A2 "Address", A3 "Phone"; I want to have in cell A4 "Name"|"Address"|"Phone"| (I want to have the three cells together separated by the pipe symbol (|).

Hugo

VBA;
[A4] = [A1] & "|" & [A2] & "|" & [A3]


Ivan
 
Upvote 0
Yes I would like to do it in VBA, as a matter of fact, after I do this I want to save the file as .txt, do you know what format should I use to save it as .txt .
 
Upvote 0
On 2002-02-17 20:40, huorsa wrote:
Yes I would like to do it in VBA, as a matter of fact, after I do this I want to save the file as .txt, do you know what format should I use to save it as .txt .
plese help i have a macro that is stuck in a loop an u help if u can email me on JLouY2K1@aol.com
 
Upvote 0
The code below will save the active sheet as a text file, named after the sheet name in your current path. It will overwrite existing files with the same name.

Sub Sv_Text()

Application.DisplayAlerts = False
fname = ActiveSheet.Name
ActiveWorkbook.SaveAs Filename:=fname & ".txt", FileFormat:= _
xlUnicodeText, CreateBackup:=False
Application.DisplayAlerts = True
End Sub


Cheers,

Nate
This message was edited by NateO on 2002-02-18 11:50
 
Upvote 0

Forum statistics

Threads
1,214,523
Messages
6,120,039
Members
448,940
Latest member
mdusw

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