+ Reply to Thread
Results 1 to 5 of 5

Using the target command to start user form macro

  1. #1
    Registered User
    Join Date
    11-04-2010
    Location
    Illinois
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    86

    Using the target command to start user form macro

    The following is code I am using to start a user form macro that will start a dialog box asking the user if they've received approval to exceed a specified threshold:
    Please Login or Register  to view this content.
    However, I can't get it to work right b/c when I change a cell value in the range I5:U5, the macro does not run (see the bolded portion in the code). I know this code works b/c I submitted a dummy workbook months ago and the code works for the dummy workbook, but when I tried to modify the code to match the actual workbook I am using, I couldn't get it to work right. Furthermore, the range I am working with is not a continous range and I want to make sure I input the right syntax for non-contiguous range as well. Any help would be greatly appreciated

    Thanks.

    HP RodNuclear
    Last edited by HP RodNuclear; 06-07-2011 at 02:36 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Using the target command to start user form macro

    Hello HP RodNuclear,

    The Target is a Range object belonging to the Active Sheet. If Sheet8 is not the Active Sheet then the test will fail. The Range objects must be on the same sheet for the Intersect method to return true.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    11-04-2010
    Location
    Illinois
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    86

    Re: Using the target command to start user form macro

    I don't understand b/c I have the sheet I want the code to operate on as the active sheet and it's not working.

    But for curiousity's sake, how would I modify the code to specify sheets within the workbook?

  4. #4
    Registered User
    Join Date
    11-04-2010
    Location
    Illinois
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    86

    Re: Using the target command to start user form macro

    ahh nevermind haha. I get it. Thanks Leith...

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Using the target command to start user form macro

    Hello HP,

    Got to love those Aha! moments.

+ 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