![]() |
Cells(i, "B") not working
Hi All,
I am using 2002 and have the following problem. The following piece of code works perfectly: '=== Calculate "comma delimited" ============================= With Range("AC12:AC" & lc) For i = 1 To rn ..Cells(i) = _ ..Cells(i, -26) & "," & _ ..Cells(i, -25) & "," & _ ..Cells(i, -24) & "," & _ ..Cells(i, -23) & "," & _ ..Cells(i, -22) & "," & _ ..Cells(i, -21) & "," & _ ..Cells(i, -20) & "," & _ ..Cells(i, -19) Next i End With Column -26 is column "B" and Column -25 is column "C" etc... So, I am given to understand that the following should work too: '=== Calculate "comma delimited" ============================= With Range("AC12:AC" & lc) For i = 1 To rn ..Cells(i) = _ ..Cells(i, "B") & "," & _ ..Cells(i, "C") & "," & _ ..Cells(i, "D") & "," & _ ..Cells(i, "E") & "," & _ ..Cells(i, "F") & "," & _ ..Cells(i, "G") & "," & _ ..Cells(i, "H") & "," & _ ..Cells(i, "I") Next i End With But it doesn't and it would make life really simple if it did. Any suggestions and comments would be greatly appreciated. Geoff |
Cells(i, "B") not working
Create range names for each of the columns select a cxolumn Insert Name Define ... - - Mark PS See my excel stuff at: http://www.geocities.com/excelmarksway "You might find something if you look in the right place" " wrote: Hi All, I am using 2002 and have the following problem. The following piece of code works perfectly: '=== Calculate "comma delimited" ============================= With Range("AC12:AC" & lc) For i = 1 To rn ..Cells(i) = _ ..Cells(i, -26) & "," & _ ..Cells(i, -25) & "," & _ ..Cells(i, -24) & "," & _ ..Cells(i, -23) & "," & _ ..Cells(i, -22) & "," & _ ..Cells(i, -21) & "," & _ ..Cells(i, -20) & "," & _ ..Cells(i, -19) Next i End With Column -26 is column "B" and Column -25 is column "C" etc... So, I am given to understand that the following should work too: '=== Calculate "comma delimited" ============================= With Range("AC12:AC" & lc) For i = 1 To rn ..Cells(i) = _ ..Cells(i, "B") & "," & _ ..Cells(i, "C") & "," & _ ..Cells(i, "D") & "," & _ ..Cells(i, "E") & "," & _ ..Cells(i, "F") & "," & _ ..Cells(i, "G") & "," & _ ..Cells(i, "H") & "," & _ ..Cells(i, "I") Next i End With But it doesn't and it would make life really simple if it did. Any suggestions and comments would be greatly appreciated. Geoff |
Cells(i, "B") not working
Thanks guys. That was a real help and is much appreciated.
BTW Mark.... I am in Sydney - perhaps a coffee sometime? Geoff |
All times are GMT +1. The time now is 09:56 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com