ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   teach me how to do range address syntax (https://www.excelbanter.com/excel-programming/422809-teach-me-how-do-range-address-syntax.html)

John Keith

teach me how to do range address syntax
 
I need some one to teach me a finer point of specifying range
addresses. I can do the simple stuff but I want to have a range
address that includes a constant and a variable like might be the case
in a loop. I've tried several approaches and I usually get an error
message ("compile error: expected: list separator or )") when I enter
the line. Here's a simple example of what I want to do:

For i = 1 to lastrow
Range("A" & i:"D" & i) = something
Next i

For each row in the loop set cells A, B, C and D to the same value.

Thanks for pushing me further down the learning curve!


John Keith


FSt1

teach me how to do range address syntax
 
hi
you have a small syntax problem.
try this...
Range("A" & i & ":D" & i).Select

regards
FSt1

"John Keith" wrote:

I need some one to teach me a finer point of specifying range
addresses. I can do the simple stuff but I want to have a range
address that includes a constant and a variable like might be the case
in a loop. I've tried several approaches and I usually get an error
message ("compile error: expected: list separator or )") when I enter
the line. Here's a simple example of what I want to do:

For i = 1 to lastrow
Range("A" & i:"D" & i) = something
Next i

For each row in the loop set cells A, B, C and D to the same value.

Thanks for pushing me further down the learning curve!


John Keith



John Keith

teach me how to do range address syntax
 
On Wed, 21 Jan 2009 22:15:01 -0800, FSt1
wrote:

hi
you have a small syntax problem.
try this...
Range("A" & i & ":D" & i).Select


Thank you! That was a combination I had not tried.


John Keith



All times are GMT +1. The time now is 05:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com