Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Add the same character(s) to multiple cells in a column (or row) . | Excel Discussion (Misc queries) | |||
Concatenate cells in Pocket Excel | Excel Discussion (Misc queries) | |||
Macro Help: Concatenate Populated Cells in Column A | Excel Discussion (Misc queries) | |||
How do I insert a symbol BEFORE text for multiple cells in Excel? | Excel Worksheet Functions | |||
how do i add the same text after current text in multiple cells | Excel Discussion (Misc queries) |