×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

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!

*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

Last Cell in a Named Range

Last Cell in a Named Range

Last Cell in a Named Range

(OP)
Hello everyone,

How can i reference the last cell in a named range of cells?
I have a range, it is a part of one column, it is named say, "XYZ" I can get to the vaious cells by using
Range("XYZ").Cells(i)
how can I, Or, Can I, reference the last cell in the range right off the bat, somehow?

Thank you

FM

VBA is making more sense by the day and begining to prove invaluble to a structural engineer.

RE: Last Cell in a Named Range

A BF&I approach:

For Each c In Range("range")
    c.Select
Next c

will stop on the last cell of the range

TTFN



RE: Last Cell in a Named Range

(OP)
Thank you

RE: Last Cell in a Named Range


Try this in your code:

LASTROW = Range("XYZ").Count

RE: Last Cell in a Named Range

I don't know the vba stuff you guys are talking about.

In excel it can be done as follows:
=+INDEX(myrange,ROWS(myrange))

This assumes that myrange defines a range of cells 1 column wide and several rows tall.   For the transpose situation, use COLS.

=====================================
Eng-tips forums: The best place on the web for engineering discussions.

RE: Last Cell in a Named Range

My mistake, the transpose is COLUMNS, not COLS.

The most general case (more than one row or column) can be handled by:
=+INDEX(myrange,ROWS(MYRANGE2),COLUMNS(myrange))

=====================================
Eng-tips forums: The best place on the web for engineering discussions.

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! Already a Member? Login



News


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close