Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Cell reference

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
R[i]C6 = "First"
i=i+1
R[i]C6 = "Second"
i=i+1
R[i]C& = "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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default Cell reference

Hi

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

Carim


Arne Hegefors wrote:[i]
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
R[i]C6 = "First"
i=i+1
R[i]C6 = "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!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Cell reference

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:
[i]
Hi

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

Carim


Arne Hegefors wrote:[i]
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
R[i]C6 = "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!



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 947
Default Cell reference

i= 11[i]
R[i]C6 = "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" wrote in message
...[i]
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
R[i]C6 = "First"
i=i+1
R[i]C6 = "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!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nesting a sheet name reference within a cell reference??? Broyston Excel Discussion (Misc queries) 9 July 8th 08 08:35 PM
Formulas that reference cells that reference another cell Andrea Excel Discussion (Misc queries) 7 October 19th 06 08:14 AM
absolute cell reference A spreadsheet cell reference that does no help Excel Discussion (Misc queries) 1 January 18th 06 06:56 PM
problem with cell reference in =sum(offset(cell reference,x,y,z,a)). Want cell ref to be variable. [email protected] Excel Worksheet Functions 2 December 11th 04 12:05 AM
Problem with =sum(offset(cell reference,w,x,y,z). I want cell reference to be variable [email protected] Excel Worksheet Functions 2 December 11th 04 12:00 AM


All times are GMT +1. The time now is 10:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"