how to code this

F

Fan924

I have line number 130 stored in cell A1. In A2, I want it to load the
contents of C130. If I change A1 to say 140, the contents of C140
should appear in A2. Not sure how to code this. TIA
 
L

Lars-Åke Aspelin

I have line number 130 stored in cell A1. In A2, I want it to load the
contents of C130. If I change A1 to say 140, the contents of C140
should appear in A2. Not sure how to code this. TIA

Try this formula in cell A2:

=OFFSET(C1,A1-1,0)

Hope this helps / Lars-Åke
 
L

Lars-Åke Aspelin

I have line number 130 stored in cell A1. In A2, I want it to load the
contents of C130. If I change A1 to say 140, the contents of C140
should appear in A2. Not sure how to code this. TIA


Here is another one you can try in cell A2:

=INDIRECT("C"&A1)

Hope this helps / Lars-Åke
 
F

Fan924

Thanks Lars,

Similar to what I have used in macros. I just drew a blank. I was able
to change it to pull data from another sheet.

=INDIRECT("SHEET1!C" & A1)
 
Top