Cell reference

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a problem with cell references, eg I want to give values to cells
belonging to a list starting with:
Worksheets(rapportWorksheet).Range("R11C6") . I then want to refer to the
cell under the cell that was last referred to. Eg R11C6, R12C7, R13C8 etc. I
want to have a variable that increases all the time, like:

Dim i as long
i= 11
RC6 = "First"
i=i+1
RC6 = "Second"
i=i+1
RC& = "Third"
etc...You get the picture. But how do you write that in code using the R1C1
reference style. The code I wrote here I just made up. PLease help me out!
Thank you very much!
 
Hello! That works fine and that is what I usually use. However sometimes it
seems to be alot easier to use the R1C1 ref since you use numbers more
directly and you can skip the hassle of using the offset. But thanks it does
works fine!

"Carim" skrev:
Hi

Would Range("R11C6").Offset(i-11, 0) be of any help ???

Carim


Arne said:
I have a problem with cell references, eg I want to give values to cells
belonging to a list starting with:
Worksheets(rapportWorksheet).Range("R11C6") . I then want to refer to the
cell under the cell that was last referred to. Eg R11C6, R12C7, R13C8 etc. I
want to have a variable that increases all the time, like:

Dim i as long
i= 11
RC6 = "First"
i=i+1
RC6 = "Second"
i=i+1
RC& = "Third"
etc...You get the picture. But how do you write that in code using the R1C1
reference style. The code I wrote here I just made up. PLease help me out!
Thank you very much!

 
i= 11
RC6 = "First"
i=i+1
RC6 = "Second"


Not sure, but would any ideas here work for you as well?

Sub Demo()
Dim v As Variant
v = [{"First"; "Second"; "Third"}]
Cells(11, 6).Resize(3, 1) = v
End Sub

--
HTH. :>)
Dana DeLouis
Windows XP, Office 2003


Arne Hegefors said:
I have a problem with cell references, eg I want to give values to cells
belonging to a list starting with:
Worksheets(rapportWorksheet).Range("R11C6") . I then want to refer to the
cell under the cell that was last referred to. Eg R11C6, R12C7, R13C8 etc.
I
want to have a variable that increases all the time, like:

Dim i as long
i= 11
RC6 = "First"
i=i+1
RC6 = "Second"
i=i+1
RC& = "Third"
etc...You get the picture. But how do you write that in code using the
R1C1
reference style. The code I wrote here I just made up. PLease help me out!
Thank you very much!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top