![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Posts: 97
|
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 |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Winnipeg
Posts: 2,330
|
Quote:
=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 ] |
|
|
|
|
|
|
#3 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
Quote:
[A4] = [A1] & "|" & [A2] & "|" & [A3] Ivan |
|
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Feb 2002
Posts: 97
|
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 .
|
|
|
|
|
|
#5 | |
|
Guest
Posts: n/a
|
Quote:
|
|
|
|
|
#6 |
|
Legend
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
|
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 ] |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|