+ Reply to Thread
Results 1 to 6 of 6

Applying restrictions around ActiveSheet.Rows(Target.Row).Select

  1. #1
    Registered User
    Join Date
    11-27-2008
    Location
    Bristol
    Posts
    13

    Applying restrictions around ActiveSheet.Rows(Target.Row).Select

    Hi,

    I'm sure (or at least hoping) this is an easy one, but here goes.

    I have a worksheet where I need an entire row to be selected whenever the user clicks any cell for that row. This is achieved using:

    Please Login or Register  to view this content.
    There are 2 issues with this:

    1. I want this to be confined only to rows in the worksheet where this is data. For example rows 1-7 are blank, and row 8 the header so these should be ignored. Equally any rows after the last row of data (according to what's in column A - which will always have values) should also be ignored. The number of rows with data is variable. Can the code be amended in someway?
    2. The worksheet in question also includes buttons assigned to 'sort' macros enabling the data to be organised according to a number of different criteria (first name, surname, DOB, etc). However the above procedure prevents these from working due to the requirement of selecting a range of cells to sort. Is there a way of "turning off" the procedure to enable the sort to take place after any of the buttons are clicked, and then it "turnt on" again afterwards?

    Help would be very much appreciated!

    Beam

  2. #2
    Registered User
    Join Date
    11-27-2008
    Location
    Bristol
    Posts
    13

    Re: Applying restrictions around ActiveSheet.Rows(Target.Row).Select

    Ok, I've sussed no.2 by disabling events before the sort and reenabling afterwards. Can anyone help with 1?

  3. #3
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Applying restrictions around ActiveSheet.Rows(Target.Row).Select

    Hi, Beam,

    like this
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Applying restrictions around ActiveSheet.Rows(Target.Row).Select

    Hi, Beam_me_up/Beam_me_ip,

    please have a look at Rule #8 - you can find the corresponding rule at Mr. Excel as well.

    http://www.mrexcel.com/forum/excel-q...ow-select.html

    Holger

  5. #5
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Applying restrictions around ActiveSheet.Rows(Target.Row).Select

    @ HaHoBe,

    Nice catch Holger!

  6. #6
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Applying restrictions around ActiveSheet.Rows(Target.Row).Select

    Something like
    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

+ 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