+ Reply to Thread
Results 1 to 3 of 3

Running Two Worksheet Change Scripts Gives Error

  1. #1
    Registered User
    Join Date
    06-29-2008
    Location
    Perth, Australia
    MS-Off Ver
    MS Office 2003
    Posts
    87

    Running Two Worksheet Change Scripts Gives Error

    I need to run two VBA scripts on the sheet1 tab:
    Please Login or Register  to view this content.
    and

    Please Login or Register  to view this content.
    But if I do this, I get an error prompt that says:
    Compile Error: Ambiguous name detected: Worksheet_Change
    I suppose I am getting this error, because I am trying to run two scripts of the same name or the same sort. If I run only one of these scripts at a time, there is no problem.

    Since my knowledge of VBA is limited to copy and paste, what should I be doing to run both scripts successfully?

    Any help will be appreciated.

    Regards.
    Attached Images Attached Images
    Last edited by BazzaBoy; 06-12-2009 at 06:52 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Running Two Worksheet Change Scripts Gives Error

    Try this:
    Please Login or Register  to view this content.
    Last edited by shg; 06-11-2009 at 07:48 PM.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    06-29-2008
    Location
    Perth, Australia
    MS-Off Ver
    MS Office 2003
    Posts
    87

    Re: Running Two Worksheet Change Scripts Gives Error

    Thanks shg,

    It works fine. The thing is the value in cell K19 depends on a drop-down list. So the dependent cells (E7:E13,I7:I13,E16:I16,E17:I17,L7:L85) don't get protected/unprotected until I take the cursor to another random unprotected cell, enter something and hit 'Enter'. You see, in a drop-down list, there is no action of hitting 'Enter'. Otherwise, the script works like a charm.

    If there is a way out of this, please let me know, otherwise this is good enough. Thank you very much.

    I do have another question, but I'll start a new thread for that.

    Regards.

+ 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