+ Reply to Thread
Results 1 to 6 of 6

referring to a range name (for Cells or Intersect, etc.)

  1. #1
    Registered User
    Join Date
    11-28-2005
    Location
    Saint Louis, Missouri USA
    MS-Off Ver
    2016
    Posts
    69

    referring to a range name (for Cells or Intersect, etc.)

    Forgive my rustiness with VBA; it's been a couple years since I've done anything substantial. (I did do a search, by the way...)

    My spreadsheet has fixed columns, each with a range name, such as "Due_Date". The rows contain individual project data. This project data gets added, edited, deleted, sorted and filtered like crazy.

    I edit it with a userform, and if it's a new record or editing an existing one, I know the row I'm dealing with, and make use of the column names and then either Cells or Intersect to put the data where it belongs.

    I have code to name new records by naming the row (i.e. turning "16:16", into "Project210". My problem is, for some of the things I wish to accomplish, I can't figure out how to refer to a record by name, if I do not already know it.

    While I have other plans, what I am trying to do today is use ActiveCell, and then determining the row I'm in by use of the unique row range name, to return the user back to the same record he/she is working on after doing a sort or filter operation.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: referring to a range name (for Cells or Intersect, etc.)

    I can't parse your question, but the row the active cell is in is activecell.row.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    11-28-2005
    Location
    Saint Louis, Missouri USA
    MS-Off Ver
    2016
    Posts
    69

    Re: referring to a range name (for Cells or Intersect, etc.)

    I am trying to determine the custom range name of the row I'm working with, such as the name "Project_201" instead of "12:12".

    I tried Activecell.Row and Activecell.Entirerow plus Name or Range.Name and several variations, but I can not return the name of the row, all I get is "12:12"

  4. #4
    Registered User
    Join Date
    11-28-2005
    Location
    Saint Louis, Missouri USA
    MS-Off Ver
    2016
    Posts
    69

    Re: referring to a range name (for Cells or Intersect, etc.)

    bumping this

    Phrasing this another way, I want to return a result that is the custom name of the range my active cell is within. Rather than return the range "12:12" when I want to determine the row I'm in, I want it to return "Project15", which was a name previously given to the row that I happen to be in.

    I have other plans, but one of the things I want to do, is if the user has an active cell in a row (project data) and then activates a function and/or sort command, I want to return the user to the same project they were working on.

  5. #5
    Valued Forum Contributor
    Join Date
    10-15-2007
    Location
    Home
    MS-Off Ver
    Office 2010, W10
    Posts
    373

    Re: referring to a range name (for Cells or Intersect, etc.)

    Hi

    Let's say you defined the name Project15 referring to row 12 in Sheet5

    Name: Project15

    Refers to: =Sheet5!$12:$12

    Now the active cell is Sheet5!E12

    Try:

    Please Login or Register  to view this content.
    You'll get "Project15" in s.

    HTH
    Last edited by lecxe; 09-02-2009 at 12:14 AM. Reason: Simplified the statement

  6. #6
    Registered User
    Join Date
    11-28-2005
    Location
    Saint Louis, Missouri USA
    MS-Off Ver
    2016
    Posts
    69

    Re: referring to a range name (for Cells or Intersect, etc.)

    Perfect. Thank you!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1