Copying several cells in one
MZ Tools makes life easier for the Excel VBA coder
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 6 of 6

Thread: Copying several cells in one

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Posts
    101
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    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. #2
    MrExcel MVP Barrie Davidson's Avatar
    Join Date
    Feb 2002
    Location
    Winnipeg
    Posts
    2,330
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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 ]

  3. #3
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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

  4. #4
    Board Regular
    Join Date
    Feb 2002
    Posts
    101
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #5
    Guest

    Default

    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

  6. #6
    Legend NateO's Avatar
    Join Date
    Feb 2002
    Location
    Minneapolis, Mn, USA
    Posts
    9,700
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    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 ]

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com