+ Reply to Thread
Results 1 to 4 of 4

vba "evaluate" code not working

  1. #1
    Forum Contributor
    Join Date
    07-08-2012
    Location
    beirut
    MS-Off Ver
    Excel 2010
    Posts
    102

    vba "evaluate" code not working

    Hello, I am making a logbook, where I enter flight details in the AllData sheet, and when I select "ok" in column L, the code should automatically copy the information to the pilots sheets and make some adjustments.
    The code I wrote with the help of the members of this forum works good for this part.
    Now if I select CLR in AllData sheet, let's say in row 6, the code should go to the pilot sheet (pilot3) and check which row has the same information as this one. (in this case it is "row 5" in "pilot3" )
    Then it should send a message box with the value of the row number.
    But the code is not working for this part, it always returns a message box with the number 0...I think the error is in the " (destRow3 = Evaluate...) part " perhaps there is something wrong or something missing, and I am not able to continue, so your help is much appreciated, thanks.
    This is the code I used, and I uploaded a sample of the workbook.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by chiidzzz; 01-25-2013 at 05:51 PM.

  2. #2
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: vba "evaluate" code not working

    the entire macro is governed by Target being "ok" only (since it is part of an ...AND ... clause) so if the target is set to CLR it does execute it just exits.

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

    Re: vba "evaluate" code not working

    Your new "CLR" code in post#1 was not included in the attached file. That was confusing.

    This uses Autofilter to find the multi-criteria match and then clears the row

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    07-08-2012
    Location
    beirut
    MS-Off Ver
    Excel 2010
    Posts
    102

    Re: vba "evaluate" code not working

    thank you alphafrog, it works
    but i need to expand it a little bit, so it searches for the entire row before deleting it, so will this one work?
    Please Login or Register  to view this content.
    and how can i make it delete the same row for the second pilot also?
    Please Login or Register  to view this content.
    thanks again

+ 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