+ Reply to Thread
Results 1 to 8 of 8

Macro to be deactivated in specific ranges

  1. #1
    Forum Contributor
    Join Date
    02-21-2007
    MS-Off Ver
    Microsoft 365 Apps for enterprise
    Posts
    389

    Macro to be deactivated in specific ranges

    Hello,

    I have 2 questions about the below Macro:

    1) Why the below part doesn't work in my current macro??
    HTML Code: 
    2) would it be possible to define like 3 ranges (with name manager. eg: "range1" "range2" "range3") and indicate the range in the macro to NOT have the macro running in these ranges (example: 12:26 = range1 / 56:56 = range2 / 76:76 = range3)

    Please Login or Register  to view this content.
    Many Thanks,
    Graig

  2. #2
    Registered User
    Join Date
    09-27-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    86

    Re: Macro to be deactivated in specific ranges

    Hi Graig,

    Your requirement is that - as you delete the row numbers changes and may be losing important numbers or formulas without knowing.
    Below code works in the dynamic way as you select any row within the named ranges, it doesn't carry out the delete operation. If it is outside the defined ranges it carries out the delete row operation.

    Please Login or Register  to view this content.
    Thanks & regards,
    Lokesh

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  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,197

    Re: Macro to be deactivated in specific ranges

    Hi, Graig,

    maybe like this
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Last edited by HaHoBe; 10-20-2014 at 12:56 PM. Reason: changed vbNo to vbYes, sorry about that
    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 Contributor
    Join Date
    02-21-2007
    MS-Off Ver
    Microsoft 365 Apps for enterprise
    Posts
    389

    Re: Macro to be deactivated in specific ranges

    Hello lokicl,

    From the clarification you have put in your answer it really reflect what I need! I tried out the macro but I got the error message attached.

    I really don't get how I could get that message as I only specify 3 range name and it seems like the macro tell not to run the macro inside the range...

    Can you please help?
    Attached Images Attached Images

  5. #5
    Forum Contributor
    Join Date
    02-21-2007
    MS-Off Ver
    Microsoft 365 Apps for enterprise
    Posts
    389

    Re: Macro to be deactivated in specific ranges

    Hello Holger,

    I haven't tried your macro. But I am afraid that if I do not define range I will have problem.. as lokicl said if I delete the row numbers changes and may be losing important numbers or formulas without knowing...

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Macro to be deactivated in specific ranges

    Perhaps:
    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  7. #7
    Registered User
    Join Date
    09-27-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    86

    Re: Macro to be deactivated in specific ranges

    Hi Graig,

    I am unable to see the error message. Please reupload again.

    Regards,
    lokicl

  8. #8
    Forum Contributor
    Join Date
    02-21-2007
    MS-Off Ver
    Microsoft 365 Apps for enterprise
    Posts
    389

    Re: Macro to be deactivated in specific ranges

    hello romperstomper!

    It works well and exactly the way I needed to have it working

    Many Thanks,
    Graig

+ 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] Macro deactivated in specific worksheet
    By graiggoriz in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 09-22-2014, 01:25 PM
  2. Macro to copy paste specific charts and ranges to PPT
    By akhileshgs in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-02-2014, 06:07 AM
  3. [SOLVED] Delete worksheet if it is deactivated?
    By Alexander_Golinsky in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-30-2013, 01:54 AM
  4. Print Macro for specific Ranges in a worksheet
    By chrisjack in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-16-2012, 03:59 PM
  5. Worksheet_Deactivate procedure leaves me on the deactivated sheet
    By carsto in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-13-2008, 05:21 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