×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Range Reference

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.

RE: Range Reference

Peter,
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

(OP)
Thanks Yakpol!

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

Hello,

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

Hello

sorry

www.mrexcel.com

----------------------------------
Hope this helps.
----------------------------------

maybe only a drafter
but the best user at this company!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources