Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Sonya795
 
Posts: n/a
Default 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


--
Sonya795
------------------------------------------------------------------------
Sonya795's Profile: http://www.excelforum.com/member.php...o&userid=26110
View this thread: http://www.excelforum.com/showthread...hreadid=397276

  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

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" wrote in
message ...

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   Report Post  
Sonya795
 
Posts: n/a
Default


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

  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

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" wrote in
message ...

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   Report Post  
Sonya795
 
Posts: n/a
Default


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


--
Sonya795
------------------------------------------------------------------------
Sonya795's Profile: http://www.excelforum.com/member.php...o&userid=26110
View this thread: http://www.excelforum.com/showthread...hreadid=397276

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add the same character(s) to multiple cells in a column (or row) . flashcatj Excel Discussion (Misc queries) 6 April 22nd 23 06:09 AM
Concatenate cells in Pocket Excel jrd05719 Excel Discussion (Misc queries) 0 June 16th 05 05:05 PM
Macro Help: Concatenate Populated Cells in Column A TJM Excel Discussion (Misc queries) 3 June 11th 05 11:25 AM
How do I insert a symbol BEFORE text for multiple cells in Excel? amspalinger Excel Worksheet Functions 6 May 17th 05 07:26 PM
how do i add the same text after current text in multiple cells Sue Excel Discussion (Misc queries) 3 January 13th 05 09:28 PM


All times are GMT +1. The time now is 06:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"