+ Reply to Thread
Results 1 to 7 of 7

Select row based on cell value

  1. #1
    Registered User
    Join Date
    08-14-2013
    Location
    Arizona
    MS-Off Ver
    Excel 2007
    Posts
    71

    Select row based on cell value

    I'm looking for the VBA to go to a row based on the value in a cell (P5). If P1=5, goto row 5.

    Thank you!
    Last edited by jwlamb; 11-25-2014 at 11:38 PM.

  2. #2
    Registered User
    Join Date
    08-14-2013
    Location
    Arizona
    MS-Off Ver
    Excel 2007
    Posts
    71

    Re: Select row based on cell value

    As a workaround, I needed to select text in col A:F with the row based on P1 value. So in Q1, =CONCATENATE("A"&P1&":F"&P1), then VBA Range(Range("Q1").Value).

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,798

    Re: Select row based on cell value

    Do you mean you want to select that row? The whole row, or just one cell? Will this be part of another macro, or stand on its own?

    This will select the first column of that row. This will work in a worksheet module for the worksheet containing these cells. It can also be used in a Module to apply to the active worksheet.
    Please Login or Register  to view this content.
    To select the whole row
    Please Login or Register  to view this content.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  4. #4
    Registered User
    Join Date
    08-14-2013
    Location
    Arizona
    MS-Off Ver
    Excel 2007
    Posts
    71

    Re: Select row based on cell value

    It's part of a userform that when they click submit, it'll strikethrough the row, but only columns A:F.

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,798

    Re: Select row based on cell value

    I responded based on your first post. Your second post is rather different. Try this. No need to use Q1 as an intermediate step.

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    08-14-2013
    Location
    Arizona
    MS-Off Ver
    Excel 2007
    Posts
    71

    Re: Select row based on cell value

    Yes.... I was trying to do it the other way around A & Row & :F & Row. I guess I'm not as excel savvy as the rest.

    Thank you!

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,798

    Re: Select row based on cell value

    You could do it that way, just a matter of preference, but you can still bypass Q1.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Select cell in a stepwise pattern that is either blank, or based on value in other cell
    By zippityzeb in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-26-2014, 08:08 AM
  2. [SOLVED] VBA: Select a Cell Based on a Value
    By iluvfnky in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-02-2014, 07:02 AM
  3. [SOLVED] Find cell based on its text value in row 1, then select the cell directly below that
    By ks100 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-06-2014, 09:40 AM
  4. Select row based on a cell value...
    By rybussell in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-20-2012, 06:26 PM
  5. VBA select cell range based upon the # of rows that make up a certain merged cell?
    By clemsoncooz in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-04-2012, 12:22 PM

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