+ Reply to Thread
Results 1 to 21 of 21

Need Help Changing current coding

  1. #1
    Forum Contributor
    Join Date
    06-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    213

    Need Help Changing current coding

    I have the following Coding that looks for certain values and check to see if the criteria is met.
    Please Login or Register  to view this content.
    In this portion it is checking to see if the Value in Sheet1 matches the Value in Sheet2. If it does its suppose to put a "Yes" in Column H. What I need changed is before it can put a "Yes" in Column H it needs to check Column F in that corresponding row and see if that date has reached. If it has then then Column H can receive a "Yes" If it hasn't then the macro ends.

    Please Login or Register  to view this content.
    Any suggestions?

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Need Help Changing current coding

    try this

    Please Login or Register  to view this content.
    Untested
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  3. #3
    Forum Contributor
    Join Date
    06-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    213

    Re: Need Help Changing current coding

    Kinda I added a little bit more:
    Please Login or Register  to view this content.
    The reason is it turns out that the cells from Sheet 1 and Sheet 2 match and but the Date in Column F hasn't been reached yet then it should update no Columns. But if the Dates from Sheets 1 and Sheet 2 do not match then it should still update Column G on Sheet 2. The Format for the date reached isn't working. I'm putting in Sept1 and its not recognizing that that date has passed and should mark Column H.

  4. #4
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Need Help Changing current coding

    can you upload a sample worksheet?....kind of working in the blind here...there are a few questions that having the data would answer....

  5. #5
    Forum Contributor
    Join Date
    06-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    213

    Re: Need Help Changing current coding


  6. #6
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Need Help Changing current coding

    sorry for being dense....is the potential outcome WS what you expect the macro to do once it's completed?

  7. #7
    Forum Contributor
    Join Date
    06-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    213

    Re: Need Help Changing current coding

    Yes, it should come out how "Potential Outcome should look like for file 5800 and 60000. But say on Sheet2 you change Cell F20 to 9/5/2014 then file number 60000 should have no values in columns G and H when the macro is done. I dont knot how if columns E and F have a Workday formula put in the cells will affect anything or not?

  8. #8
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Need Help Changing current coding

    but not for files 5802 and 7890....is that correct....I'm trying to follow the logic....

  9. #9
    Forum Contributor
    Join Date
    06-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    213

    Re: Need Help Changing current coding

    Those files require another macro that hasnt been developed yet so for this macro they will not be touched.

  10. #10
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Need Help Changing current coding

    sorry for asking another question...

    in the potential outcome WS you have a yes in G16 for file 5800...

    the logic in your posts states that if Sheet1 column F (Date) for that file number which is 5800 and that date is 9/3/14 (forgot formatting right now) equals Sheet2 5800 date in column D AND the date in Column F is less then Today....but the date in sheet 2 for file 5800 is 8/31/14 and will never have a "yes" in either column...

    what am I missing?

  11. #11
    Forum Contributor
    Join Date
    06-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    213

    Re: Need Help Changing current coding

    Yes the original coding states

    Please Login or Register  to view this content.
    So if the Date on Sheet2 does not match the Date on Sheet 1 and Column I has no Value then Column G will receive a Yes.

    For 60000 The dates on sheet 1 and sheet 2 match so it will trigger the next if statement. it will check Column F to see if that date has been met yet if it has then Column H will receive a Yes. If the dates on sheet1 and sheet2 do match and the date in Column F has not been met or passed then no Columns will receive a "Yes" which will happen if you change the date to 9/4/14 for Cell F20. Hopefully this helps explain exactly what I'm trying for.

  12. #12
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Need Help Changing current coding

    I hope I'm closer ... for some reason it's taking me a bit to get my head wrapped around the logic....but give this a try....

    Please Login or Register  to view this content.

  13. #13
    Forum Contributor
    Join Date
    06-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    213

    Re: Need Help Changing current coding

    It seems to be working the way I need it to. I appreciate all the help. Since you have an understanding for this would you like to try and help me with the next portion. Regarding the other two files on that sheet?

  14. #14
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Need Help Changing current coding

    I wouldn't mind at all but I just had project dropped in my lap...if you can wait until tomorrow I can help....

  15. #15
    Forum Contributor
    Join Date
    06-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    213

    Re: Need Help Changing current coding

    Not a problem I'll message you the details if you want.

  16. #16
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Need Help Changing current coding

    work for me....

  17. #17
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Need Help Changing current coding

    I had to cheat a bit, hopefully it won't be to much of a problem....I added duplicate numbers on sheet2 for the file numbers....it made it easier to determine what goes where...I also adjust your WORKDAY() formulas to allow for blank data....give it a go and let me know....

    MODS: I was requested to add some more code to the original VBA Code. I update this OP (even though it's set to SOLVED) because this where it started. Hopefully I'm not violating the "Must start a new thread" rules....please advise
    Attached Files Attached Files
    Last edited by judgeh59; 09-04-2014 at 03:29 PM.

  18. #18
    Forum Contributor
    Join Date
    06-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    213

    Re: Need Help Changing current coding

    Thanks for the update. It almost works correctly. Since you have to duplicate the file numbers can we do it a different way. Because right now it it finds a file number it will continue with the whole process and end up filling on MIA2 or 3 if those ones havent been met yet. The reason for the differnent MIA's is because this is updating a much bigger sheet and it could be pulling files from 6 months ago that were once declared MIA and now are MIA again so it will need to be updated.

    So my idea for the file numbers is a follow:
    I asked for it to check Column I and to see if it equals the value of "Yes". If that value is found its suppose to go to the next row. It should go back to Column A and copy the file number to the cell right below it. And then rerun the previous Check to see if the Value of "Yes" is in this new rows column of I. If no value is found it will go to Column D and see if it is empty just like how you had it. If there is a value of yes then it will re run the previous section. And then it will continue on with macro. This way it only adds file numbers to the MIA's that are being used.

    Also it was working on the last one you sent but on this one it is not.The Possible MIA Column should only equal yes if Column I has no Value and Column F's Date is reached or has passed based on the date the macro is run.

    Hopefully this makes sense I'm just writing down ideas that are popping in my head regarding this macro. I do appreciate all the help.

  19. #19
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Need Help Changing current coding

    Hi Trevor;

    I keep trying to get back to this and it looks like I'm not going to be able to....you should probably start a new thread with the updated requests....sorry it took so long....

  20. #20
    Forum Contributor
    Join Date
    06-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    213

    Re: Need Help Changing current coding

    Thanks for the help I appreciate it. I'll see if I can get more ideas from a new thread. Thanks again.

  21. #21
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Need Help Changing current coding

    I'm glad I could help a little....have a great day

+ 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. Changing a part of a formula using VBA coding
    By nav505 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-05-2013, 04:12 PM
  2. [SOLVED] changing cell value in vba at current row
    By KAPearson in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-19-2012, 02:16 PM
  3. Coding to determine if current sheet is last sheet in workbook
    By som3on3_10 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-29-2011, 03:07 AM
  4. Changing ranges of current code
    By rhudgins in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-14-2011, 01:42 PM
  5. coding for changing worksheet name
    By mingali in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-29-2009, 10:24 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