Range Reference
Range Reference
(OP)
Is it possible to refer to a range of cells using index numbers, rather than using A1 notation?
I want to write a generic cell-range copy routine, that will copy variable-size ranges from some Cell(row A, column A) through to Cell(row B, column B), to a new location anchored at Cell(row C, column C). Only thing is, I only have row and column numbers to work with, and would prefer not having to translate that into A1 notation.
Thanks
Peter.
I want to write a generic cell-range copy routine, that will copy variable-size ranges from some Cell(row A, column A) through to Cell(row B, column B), to a new location anchored at Cell(row C, column C). Only thing is, I only have row and column numbers to work with, and would prefer not having to translate that into A1 notation.
Thanks
Peter.





RE: Range Reference
I assume you are asking about VBA manipulations, not worksheet functions. Use statements Cells(row, column) to access cells not using alphabetical notations. Within a certain range the indexes will be local. range.cells(row, column). To create a range use statements like
Set rng = cells(row, column).resize(Nrows, Ncolumns)
hope it helps!
RE: Range Reference
I tried it and it works like a charm.
I'm embarrased to say how long I had spent searching through Excel's VBA online help and getting nowhere. Then I post my question here just before leaving work, and found the answer waiting for me the next day. I love this forum.
PeterAB.
RE: Range Reference
If you think this forum site is good (which it is) for Excel and Access questions visit mrexcel.com
----------------------------------
Hope this helps.
----------------------------------
maybe only a drafter
but the best user at this company!
RE: Range Reference
sorry
www.mrexcel.com
----------------------------------
Hope this helps.
----------------------------------
maybe only a drafter
but the best user at this company!
RE: Range Reference
http://www.tek-tips.com