+ Reply to Thread
Results 1 to 5 of 5

Concatenate Multiple Cells

  1. #1
    Registered User
    Join Date
    08-09-2005
    Posts
    7

    Question Concatenate Multiple Cells

    Hello everyone.

    I need your help.
    I using FOR LOOP to loop through N-number of times in order to find necessary data.
    I have trouble placing this data in ONE cell:
    Here is code that I use

    For i = 1 To intRowCount

    ActiveCell.FormulaR1C1 = "=R" & Range("F26").Value & "C3&""|"" "
    Range("F26").Value = Range("F26").Value + 1


    ActiveCell.Value = ActiveCell.Value + ActiveCell.Value ' + ActiveCell.Offset(1, 0).Select
    Next i

    How to place programmatically found data into ONE cell
    Thanks in advance,

    Sonya

  2. #2
    Bob Phillips
    Guest

    Re: Concatenate Multiple Cells

    Not clear on what you are doing.

    The first formula creates a formula such as =$C$7&"|"

    You then try to add that to itself, which doesn't work as it has text. Do
    you mean?

    ActiveCell.Value = ActiveCell.Value & ActiveCell.Value


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Sonya795" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hello everyone.
    >
    > I need your help.
    > I using FOR LOOP to loop through N-number of times in order to find
    > necessary data.
    > I have trouble placing this data in ONE cell:
    > Here is code that I use
    >
    > For i = 1 To intRowCount
    >
    > ActiveCell.FormulaR1C1 = "=R" & Range("F26").Value & "C3&""|"" "
    > Range("F26").Value = Range("F26").Value + 1
    >
    >
    > ActiveCell.Value = ActiveCell.Value + ActiveCell.Value ' +
    > ActiveCell.Offset(1, 0).Select
    > Next i
    >
    > How to place programmatically found data into ONE cell
    > Thanks in advance,
    >
    > Sonya
    >
    >
    > --
    > Sonya795
    > ------------------------------------------------------------------------
    > Sonya795's Profile:

    http://www.excelforum.com/member.php...o&userid=26110
    > View this thread: http://www.excelforum.com/showthread...hreadid=397276
    >




  3. #3
    Registered User
    Join Date
    08-09-2005
    Posts
    7
    Bob,

    Here is the exact code that I am using:

    For i = 1 To intRowCount

    ActiveCell.FormulaR1C1 = "=R" & Range("F26").Value & "C3"
    Range("F26").Value = Range("F26").Value + 1

    ActiveCell.Offset(1, 0).Select

    next i

    Asumming that intRowCount= 4 (it is a variable)

    I will get four new rows Column B
    row 15 XXXXXXXXX
    row 16 YYYYYYYYYY
    row 17 ZZZZZZZZZ
    row 18 PPPPPPPPP

    But I need all these four rows be ONE. Is there a way to concatanate them in a LOOP?
    Thank you,
    Sonya

  4. #4
    Bob Phillips
    Guest

    Re: Concatenate Multiple Cells

    Hi Sonya,

    Perhaps this

    With ActiveCell
    .Value = ""
    For i = 1 To intRowCount
    .Value = .Value & "R" & Range("F26").Value + _
    i - 1 & "C3" & "&"
    Next i
    .FormulaR1C1 = "=" & Left(.Value, Len(.Value) - 1)
    End With


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Sonya795" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Bob,
    >
    > Here is the exact code that I am using:
    >
    > For i = 1 To intRowCount
    >
    > ActiveCell.FormulaR1C1 = "=R" & Range("F26").Value & "C3"
    > Range("F26").Value = Range("F26").Value + 1
    >
    > ActiveCell.Offset(1, 0).Select
    >
    > next i
    >
    > Asumming that intRowCount= 4 (it is a variable)
    >
    > I will get four new rows Column B
    > row 15 XXXXXXXXX
    > row 16 YYYYYYYYYY
    > row 17 ZZZZZZZZZ
    > row 18 PPPPPPPPP
    >
    > But I need all these four rows be ONE. Is there a way to concatanate
    > them in a LOOP?
    > Thank you,
    > Sonya
    >
    >
    > --
    > Sonya795
    > ------------------------------------------------------------------------
    > Sonya795's Profile:

    http://www.excelforum.com/member.php...o&userid=26110
    > View this thread: http://www.excelforum.com/showthread...hreadid=397276
    >




  5. #5
    Registered User
    Join Date
    08-09-2005
    Posts
    7

    Thank you

    Bob,
    Thank you a lot.
    You suggestion works perfectly!!!
    Thanks a million.
    Sonya

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1