+ Reply to Thread
Results 1 to 22 of 22

Need Help altering my VBA code.

  1. #1
    Forum Contributor
    Join Date
    10-25-2016
    Location
    Derby, England
    MS-Off Ver
    MS 2013
    Posts
    228

    Need Help altering my VBA code.

    Hi,

    Please can someone help me to put a couple of issues right?

    At the moment when an operator selects Azera, L, M,and N from the drop down menu in cell E it puts a "YES" in cell L, but if the operator was to select say L by mistake and then selected K, the "YES" still stays in cell L.

    I would like when I change the letter in cell E drop down menu cell L also changes to suit.

    Azera, L, M, and N = YES all the others to say N/A.

    Also i'd like it if you could help me so when I deleted whatever is in cell E, its also deleted whats in cell L.

    Any help on this would be appreciated.

    Kind Regards
    Dan
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Need Help altering my VBA code.

    This seems to be identical to your other thread: https://www.excelforum.com/excel-gen...t=#post4608486

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,256

    Re: Need Help altering my VBA code.

    Yep, identical thread.
    Try this formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and copy down

  4. #4
    Forum Contributor
    Join Date
    10-25-2016
    Location
    Derby, England
    MS-Off Ver
    MS 2013
    Posts
    228

    Re: Need Help altering my VBA code.

    Hi,

    Sorry, I just thought if I entered it in both the General & Programming, i'd hopefully get more people looking at it. I won't do it again.

    sintek, thank you for your suggestion. I've entered your formula, but unfortunately once I click yes on the message box after I select from the drop down menu, it overwrites your formula.

    Kind Regards
    Dan

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,256

    Re: Need Help altering my VBA code.

    Hi dan

    "Yes" on which message box

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,256

    Re: Need Help altering my VBA code.

    I see you've created a rule that formats if cell value contains 'Yes' ????

  7. #7
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,256

    Re: Need Help altering my VBA code.

    May i ask why you have the message as follows appear:
    message.gif
    and when Yes is chosen, column L gets replaced with "Yes" when this is not the criteria required as per original enquiry.

  8. #8
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,256

    Re: Need Help altering my VBA code.

    Why this code:

    Please Login or Register  to view this content.
    The above code is overwriting the formula

  9. #9
    Forum Contributor
    Join Date
    10-25-2016
    Location
    Derby, England
    MS-Off Ver
    MS 2013
    Posts
    228

    Re: Need Help altering my VBA code.

    Hi Sintek,

    OK I now see now what you're saying. My apologies, I forgot to mention that the "YES" is put in cell L by the command of the message box "YES" button.

    I need that code/message box to alert the operators to make sure they are doing the job correctly. That's why I attached my file just in case of something like this.

    I hope it makes more sense now.

    Kind Regards
    Dan

  10. #10
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,256

    Re: Need Help altering my VBA code.

    Should the answer "YES" or "No" not be put in column M ("Comments") because you are overwriting the required result in your original post.
    Last edited by sintek; 03-18-2017 at 11:31 AM.

  11. #11
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,256

    Re: Need Help altering my VBA code.

    Now i get it..... Silly me...The code needs to be adapted.

    Surely, this should work:
    Please Login or Register  to view this content.
    Last edited by sintek; 03-18-2017 at 12:06 PM.

  12. #12
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Need Help altering my VBA code.

    sintek,
    I tried doing something similar to what you did earlier this morning, but when it went into the loop, it would error out at the
    Please Login or Register  to view this content.
    line and excel would crash.
    I tried it with your code and the same thing happened. I'm just wondering if it's something on my end or with the workbook itself.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  13. #13
    Forum Contributor
    Join Date
    10-25-2016
    Location
    Derby, England
    MS-Off Ver
    MS 2013
    Posts
    228

    Re: Need Help altering my VBA code.

    I've tried that sintek but it comes up with a run time error 28 out of stack space and when I debug it, its highlights if not intersect (target, range G:G)) is nothing then.

    any ideas?

    Kind Regards
    Dan

  14. #14
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Need Help altering my VBA code.

    Ok...not on my end.

  15. #15
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,256

    Re: Need Help altering my VBA code.

    Hi Guys....Strange, it worked perfectly on my side earlier.... NOW gives errors as follows:
    Untitled-1.gifUntitled-2.gif

  16. #16
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Need Help altering my VBA code.

    Exactly the error(s) I was getting. Not to sure what's happening there.

  17. #17
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,256

    Re: Need Help altering my VBA code.

    Yeah, that is a bit of a tricky one lol

  18. #18
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,256

    Re: Need Help altering my VBA code.

    If anyone out there figures out...please post results

  19. #19
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Need Help altering my VBA code.

    Questions:
    Why is it even going to that line? The loop is supposed to be going to next cel not back to the beginning of the code. Or am I just crazy?
    Is the loop even necessary?
    Last edited by gmr4evr1; 03-18-2017 at 02:47 PM. Reason: Added 2nd question

  20. #20
    Forum Contributor
    Join Date
    10-25-2016
    Location
    Derby, England
    MS-Off Ver
    MS 2013
    Posts
    228

    Re: Need Help altering my VBA code.

    Hi Guys,

    I've managed to sort it and get what I want by editing the VBA code and also using your formula Sintek.

    So thank you for all your help and suggestions, its much appreciated.

    Kind Regards
    Dan

  21. #21
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,256

    Re: Need Help altering my VBA code.

    Good stuff Dan

    Pls mark thread as solved and hit the star to add rep points!!!

  22. #22
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Need Help altering my VBA code.

    Glad you were able to get it working.

+ 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. VBA Code for altering a series of data
    By willscc87 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-01-2016, 07:09 PM
  2. Help Altering Code that Was Created
    By trevor2524 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-08-2014, 09:55 AM
  3. [SOLVED] Need Help Altering Code
    By basketball2524 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-04-2014, 01:05 PM
  4. [SOLVED] Altering existing formulas using VBA code
    By TheRobsterUK in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-14-2014, 11:35 AM
  5. Altering existing macro code
    By jsmity in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-03-2010, 01:05 PM
  6. Altering Range in Code
    By Janc in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 11-02-2009, 07:27 AM
  7. altering URLs with code
    By imimin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-23-2006, 12:45 AM

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