Thread: Ranges / Loops
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Pete McCOsh Pete McCOsh is offline
external usenet poster
 
Posts: 64
Default Ranges / Loops

Range(cells(1,1+i),cells(2,1+i)).select

Will select A1:A2 then B1:B2 and so forth as i increases
from 0. I think that's what you're trying to do. If you're
trying to move down columns, shift the variable onto the
other side of the "cells" references.

Cheers, Pete

-----Original Message-----
Hi there.

I want to use a loop in order to write into different,

consecutive
ranges. Therefore, i need to include the counting

variable i in the
range definition. The expression below would be inside a

loop:

Range(R[1]C[1+i]:R[2]C[1+i]).Select

Now the syntax is wrong... How SHOULD it be? Can I use

the form

Range("A1:B1").Select

to do the same thing?

Range("A1"&i:"B1"&i).Select

doesnt work....

Cheers!

Fabalicious


---
Message posted from http://www.ExcelForum.com/

.