+ Reply to Thread
Results 1 to 5 of 5

Highlight range of cells - run macro - select last cell in range

  1. #1
    Registered User
    Join Date
    01-12-2010
    Location
    Massachusetts
    MS-Off Ver
    Excel 2010
    Posts
    47

    Highlight range of cells - run macro - select last cell in range

    We would like to highlight a range of cells, for example G12:I30. Then we want to use the Shortcut: Ctrl+Shift+R to select cell A30 ( Column A - the last row in the range).

    We normally have to type information in a form that could be filled automatically if we could figure out how to select specific cells in a highlighted range.

    As always - thanks in advance.
    Last edited by chromachem; 03-24-2012 at 11:46 AM. Reason: Solved

  2. #2
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Highlight range of cells - run macro - select last cell in range

    are you doing anything to the data? or just highlighting it?

    if just highlighting it, what would be the objective with selecting cell A30?
    If you liked my solution, please click on the Star -- to add to my reputation

    If your issue as been resolved, please clearly state so and mark the thread as [SOLVED] using the thread tools just above the first post.

  3. #3
    Registered User
    Join Date
    01-12-2010
    Location
    Massachusetts
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: Highlight range of cells - run macro - select last cell in range

    The contents of cell A30 contain a value that will be stored in an array starting at A12 ending at A30. I want to write a project that will use values that are in cells in any column from the top row of the selected range to the bottom row of the selected range.

    Once we know a way to reference the last row, we can make an array storing Lab ID's starting in Column A in the top row of the highlighted range as strLabID(0) going to the bottom row of Column A in the highlighted range as strLabID(whatever row is the bottom highlighted row).

    We use forms to enter data that is used to write Laboratory reports for soil and water samples analyzed in our lab. Each row for a sample has a Lab ID, date sampled, date rec'd, samplers name, a list of analyses required, etc... The columns where each specific test are located on the "To Do" sheet start at Column G.


    The idea is to highlight a range of tests that are ready for reporting, use the Shortcut: Ctrl+Shift+R, fill arrays with Lab ID, Client, ClientID... and use the arrays to fill in Lab Reports.

    If we knew the bottom row and top row (row numbers), we could write a report from the top row through the bottom row. We would know where to start, where to end, and how to reference any cell in any row and column.
    Attached Files Attached Files
    Last edited by chromachem; 03-24-2012 at 09:17 AM.

  4. #4
    Registered User
    Join Date
    01-12-2010
    Location
    Massachusetts
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: Highlight range of cells - run macro - select last cell in range

    I finally thought of a straight forward way to ask my question.

    The only thing I really need to know is the starting row number and the ending row number. I guess a better way to phrase the question would be:

    intFirstRowHighlighted =
    intLastRowHighlighted =
    Last edited by chromachem; 03-24-2012 at 09:56 AM.

  5. #5
    Registered User
    Join Date
    01-12-2010
    Location
    Massachusetts
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: Highlight range of cells - run macro - select last cell in range

    Hello All,

    I figured it out. The wife and kids left me in peace for an hour and I had a minute to think.

    Here is code.

    Please Login or Register  to view this content.
    Thanks to all who looked.
    Last edited by arlu1201; 03-29-2012 at 03:06 AM. Reason: You missed out the ending code tag.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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