+ Reply to Thread
Results 1 to 8 of 8

Only perform macro if a cell from a specific range is selected (SOLVED)

  1. #1
    Registered User
    Join Date
    03-08-2011
    Location
    Montreal, Canada
    MS-Off Ver
    Excel 2007
    Posts
    34

    Only perform macro if a cell from a specific range is selected (SOLVED)

    Hello,

    I have 2 problems with a specific macro I created. The macro creates a new worksheet that is a copy of my template sheet and renames it to the value in the original cell on my "Masterlist". My problem is I only want this to happen when a new item is entered in range("b11:b"). Right now it happens when you enter new text in any cell in the "Masterlist" sheet.

    My second issue is when I delete an entry on the "Masterlist" it also creates a new copy and then renames it. How could I alter my code to avoid this.

    Thank you for any help.

    Dave


    Please Login or Register  to view this content.
    Last edited by daivd_vachon; 10-12-2012 at 03:48 PM.

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Only perform macro if a cell from a specific range is selected

    Hi David

    As to your first issue try this
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Registered User
    Join Date
    03-08-2011
    Location
    Montreal, Canada
    MS-Off Ver
    Excel 2007
    Posts
    34

    Re: Only perform macro if a cell from a specific range is selected

    Hi jaslake,

    It doesn't seem to do the job. Also would it have worked with a range specified, for ex. b11:b or is it only for 1 cell. Also anyone idea as to my second problem?

    Thanks for your time

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Only perform macro if a cell from a specific range is selected

    Hi David

    My experience is quite limited but I don't know what range b11:b is...far as I know it's not a range...can you explain it to me?

    The code I proposed is limited to one cell B11...it's why I asked the questions I asked...please respond.

    Never mind...confused Threads. What exaclly is Range("b11:b")?
    Last edited by jaslake; 10-11-2012 at 05:05 PM.

  5. #5
    Registered User
    Join Date
    03-08-2011
    Location
    Montreal, Canada
    MS-Off Ver
    Excel 2007
    Posts
    34

    Re: Only perform macro if a cell from a specific range is selected

    What I mean't was from cell B11 down to the bottom of column B sorry for the confusion. So if anything is entered in column B under B11 the macro will functions.

    Thank you,

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Only perform macro if a cell from a specific range is selected

    Hi David

    Are there any blank cells between B11 and the last filled cell in Column B? If not try this (untested)
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    03-08-2011
    Location
    Montreal, Canada
    MS-Off Ver
    Excel 2007
    Posts
    34

    Re: Only perform macro if a cell from a specific range is selected

    Wow thank you jaslake, you solved both my problems A+

  8. #8
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Only perform macro if a cell from a specific range is selected

    Hi David

    You're welcome...glad I could help.

    PS: You marked you Thread as SOLVED incorrectly

    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
    Last edited by jaslake; 10-12-2012 at 04:24 PM. Reason: Add PS

+ 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