+ Reply to Thread
Results 1 to 5 of 5

Testing single code, work fine. Put multiple codes in one sheet, one code doesn't work.

  1. #1
    Registered User
    Join Date
    03-29-2017
    Location
    Fiji
    MS-Off Ver
    2019
    Posts
    12

    Testing single code, work fine. Put multiple codes in one sheet, one code doesn't work.

    Hi, I want K to clear every time there is an update whether it is changing value or delete value (blank). I tested single code in separate sheet and it work fine, but when I put all my codes together. COL K only clear when I make change to W:AP but when I delete value from W:AP, COL K doesn't clear.

    Thank you!

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Testing single code, work fine. Put multiple codes in one sheet, one code doesn't work

    Please Login or Register  to view this content.
    This line exits the sub if the target is more than one cell or is empty.

    You later try to loop through all the target cells in column W:AP that you cleared. That part of the code never runs if you deleted more than one cell.

    Try putting the code to Clear Verification before Prevent duplicate name.
    Last edited by AlphaFrog; 03-29-2017 at 09:27 PM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    03-29-2017
    Location
    Fiji
    MS-Off Ver
    2019
    Posts
    12

    Re: Testing single code, work fine. Put multiple codes in one sheet, one code doesn't work

    Hi I tried to swap the code then 'Prevent Duplicate Name code show error at line

    Thank you for your help!

    Please Login or Register  to view this content.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Testing single code, work fine. Put multiple codes in one sheet, one code doesn't work

    Try this (not tested).

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-29-2017
    Location
    Fiji
    MS-Off Ver
    2019
    Posts
    12

    Re: Testing single code, work fine. Put multiple codes in one sheet, one code doesn't work

    It work perfectly! Thank you!

+ 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] Need help with VBA code. Tons of code seperated in two, second part of code doesn't work.
    By FragaGeddon in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 11-30-2015, 11:46 AM
  2. Replies: 4
    Last Post: 01-04-2015, 03:45 PM
  3. [SOLVED] [Solved] Looping Thru Sheet Code Doesn't Work. Please help
    By bernice620 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-21-2012, 03:22 PM
  4. Looping Thru Sheet Code Doesn't Work. Please help
    By bernice620 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-20-2012, 05:07 PM
  5. Getting this code to work on MAC (ERROR 68) - works fine on Windows
    By LT1511 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-30-2012, 11:09 PM
  6. VBA code doesn't work when formula in sheet is removed
    By Marco-Kun in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-16-2009, 01:18 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