Excel cell selection based on variable containing row number

How to select a cell based on the beginPosition variable containing the row number. For example, if my beginPosition variable is 10, how would I select cell A10?

I tried to use the Range function, but this does not work very well (error).

+4
source share
2 answers
 Range("A" & beginPosition).Select 
+7
source

Use the INDIRECT function

for example, if cell A1 has 4, the function = INDIRECT ("C" and A1) will return the contents of cell C4.

http://www.freelists.org/post/mso/ExcelVariable-cell-reference.5

+10
source

Source: https://habr.com/ru/post/1403701/


All Articles