Concatenate Multiple Cells

  • Thread starter Thread starter Sonya795
  • Start date Start date
S

Sonya795

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
 
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)
 
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 concatanat
them in a LOOP?
Thank you,
Sony
 
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top