PDA

View Full Version : expression for offset()



sakura.saki
06-20-2012, 06:16 AM
Hi I am now having a problem with the expression: I wish to express the cell like:
range("A").offset(0,j)&count1.row (this is of cause wrong)

or something like: Sheets("Word").Range(("A").Offset(0, j)& count1).Value = Sheets("teams CW").Range("F1").Value (this is also wrong)

which means the column j from A and then the the cell within it which is determined by row number of count1.row...I have the following but donīt known how to add the offset(j,0) into it to have the right expression....can anyone help with it? thanks!

count1 = Source2.Row - Source1.Row + 6
Sheets("Word").Range("A" & count1).Value = Sheets("teams CW").Range("F1").Value

Kenneth Hobs
06-20-2012, 07:13 AM
Sheets("Word").Range("A" & count1).offset(,j).Value = Sheets("teams CW").Range("F1").Value

mikerickson
06-20-2012, 07:26 AM
if count1 is an integer, perhaps
Sheets("Word").Cells(count1, j).Value = Sheets("teams CW").Range("F1").Value
if count1 is a cell,
Sheets("Word").Cells(count1.Row, j).Value = Sheets("teams CW").Range("F1").Value

sakura.saki
06-20-2012, 07:41 AM
thanks a lot! really thoughtful

sakura.saki
06-20-2012, 07:42 AM
thank you too. but it was not what I meant. nevermind. solved already.:-)

snb
06-20-2012, 09:01 AM
If you want to use numbers you'd better use 'cells':



Sheets("Word").cells(Source2.Row - Source1.Row + 6,1).Value = Sheets("teams CW").Range("F1").Value