+ Reply to Thread
Results 1 to 10 of 10

VBA Code will not work automatically when cell value met - have to manually run code?

  1. #1
    Registered User
    Join Date
    10-25-2012
    Location
    Northamptonshire
    MS-Off Ver
    Excel 2010
    Posts
    54

    VBA Code will not work automatically when cell value met - have to manually run code?

    Dear Experts,

    I came across some vba coding to help me cut and paste a row of data automatically from one sheet to another when cell value is met. The code will work if I go to the Visual Basic Editor and press the Run Sub/User Form (sometimes I have to click it a couple of times to get it to work- not sure why!) but I want the code to work automatically when the cell value in column 'E' equals 'NO' and not have to click Run Sub/User Form in Visual Basic Editor.

    Can someone help me to modify the code to work automatically as I can not see what is wrong. I am working with excel 2013 and I have attached the test workbook to help.

    Many thanks in advance for any help given.
    Kaz
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA Code will not work automatically when cell value met - have to manually run code?

    You still have not resolved the issue yet.
    I remember you had an event driven, but was not working for you, though, it did work when I tested it. I had written you another code, but you are back to square one. The attached code is not even driven code.

  3. #3
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: VBA Code will not work automatically when cell value met - have to manually run code?

    I just converted your macro to run automatic instead of manual process. I have not done any change in your macro coding.

    Copy the below code and do right click on sheet2 sheet tab and select view cod and paste it.

    This event will trigger whenever any change happens in any of the cell of Column E of sheet2.

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA Code will not work automatically when cell value met - have to manually run code?

    Sixthsense,
    The OP had a working code(Not the attached). The code was posted with an attachment. The code was working fine, but for some unknown reason, it did not work on his PC. I made some suggestion, but to no avail.

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA Code will not work automatically when cell value met - have to manually run code?


  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: VBA Code will not work automatically when cell value met - have to manually run code?

    @ AB33,

    Thanks for the alert

    I have downloaded the OP's file and found that there is no event code is available in OP's file. OP is having a single code in a module and ThisWorkbook Code window and it is a manual running code with Private Declaration.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Apart from that there is no event code is found in OP's file to do the job automatically.

    Please correct me if I am wrong...

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA Code will not work automatically when cell value met - have to manually run code?

    Sixthsense,
    Look at the link!
    There is a code on the sheet no 17(Post #1)

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    10-25-2012
    Location
    Northamptonshire
    MS-Off Ver
    Excel 2010
    Posts
    54

    Re: VBA Code will not work automatically when cell value met - have to manually run code?

    Dear AB33, I am very sorry if I have caused any problems. All I am trying to do is resolve an issue that I have. As explained, I could not get the code to work no matter what I tried with and without your guidance. As stated, I was looking for a code I could use to automatically cut and paste rows of data from one sheet to another based on cell value, which is what Sixsenth is helping with. I thought I would try and use a different code but not being very experienced with VBA coding I tend to play in the dark and try to make coding I find suit my needs but no matter what I tried I could not find an automatic solution hence the request for help.

    Apologies if I have offended you.

    Kind regards
    Kaz

  9. #9
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA Code will not work automatically when cell value met - have to manually run code?

    Kaz,
    Not at all!
    The bottom line is to get a solution. Hopefully, this new code works for you.

  10. #10
    Registered User
    Join Date
    10-25-2012
    Location
    Northamptonshire
    MS-Off Ver
    Excel 2010
    Posts
    54

    Re: VBA Code will not work automatically when cell value met - have to manually run code?

    Dear AB33,

    Thank you. I was worried that I had done something very wrong. I hope in the future that if I need some additional help you will still be happy to help. I am just looking at the revised coding given by Sixsense.


    Thanks,
    Kaz

+ 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] VBA Code to automatically save work Item
    By Janto724 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-25-2013, 01:59 PM
  2. Code Only Running Manually
    By PasteSpecialValues in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-26-2011, 06:40 PM
  3. making a macro run automatically on start and make code work only on first sheet
    By Alheksi in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-12-2010, 04:18 AM
  4. code to work on displaying date automatically
    By tweety127 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-15-2008, 12:51 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