+ Reply to Thread
Results 1 to 18 of 18

Automatically Clear Rows When Condition Is Met

  1. #1
    Registered User
    Join Date
    09-11-2008
    Location
    CO
    MS-Off Ver
    Office 2007
    Posts
    40

    Automatically Clear Rows When Condition Is Met

    I've got a workbook (attached) with a "summary" sheet & 2 detail sheets for tracking vacation time used, and I need to make it automatically clear out an employee's "used" vacation hours automatically on their anniversary date.

    Can anybody help me please? I've had no luck thus far & "the powers that be" are really getting on me for this now - Thanks in advance for any help!
    Attached Files Attached Files
    Last edited by TheLostBoy; 02-06-2009 at 09:03 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Automatically Clear Rows When Condition Is Met

    Don't duplicate posts, bump the original. If you haven't received an answer maybe you need to explain more clearly and/or attach an example.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    09-11-2008
    Location
    CO
    MS-Off Ver
    Office 2007
    Posts
    40

    Re: Automatically Clear Rows When Condition Is Met

    My originals had more detail but got no response, so I wanted to try to make them more concise. I'm sorry for the repost, but the 'Edit' button was gone so I couldn't clean them up.

    Examples have been attached to all of my posts... Are they not showing up?

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Automatically Clear Rows When Condition Is Met

    You don't "clean up" the original post, you add a new post to it with more explanation & this will also bump it up the forum.

  5. #5
    Registered User
    Join Date
    10-15-2007
    Location
    Charlotte, NC
    MS-Off Ver
    2003
    Posts
    50

    Re: Automatically Clear Rows When Condition Is Met

    When is their annivesary date? seems to me you could use a formula to clear the cells.

    something like:

    =if(H3="anniversarydate", "cell range" = "","")

    not tested! just a thought.

    Larry

  6. #6
    Registered User
    Join Date
    09-11-2008
    Location
    CO
    MS-Off Ver
    Office 2007
    Posts
    40

    Re: Automatically Clear Rows When Condition Is Met

    I've only had 1 response asking for more information on any of them, to which I replied but got no further response. Is there anything specific I'm lacking? I'm happy to provide any information needed, I just don't know what that might be...

    I'm sorry if I came off sounding argumentative before; I certainly wouldn't try to contradict anybody here & ask for help at the same time, and I appreciate the advice thus far.

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Automatically Clear Rows When Condition Is Met

    I looked at the example but also could not tell when the anniversary date occurred.

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Automatically Clear Rows When Condition Is Met

    Where are the vacation days stored?

  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Automatically Clear Rows When Condition Is Met

    You seem to allocate vacation hours according to years from the hire date using the datedif function. How would you clear this?

  10. #10
    Registered User
    Join Date
    09-11-2008
    Location
    CO
    MS-Off Ver
    Office 2007
    Posts
    40

    Re: Automatically Clear Rows When Condition Is Met

    Quote Originally Posted by LarryC View Post
    When is their annivesary date? seems to me you could use a formula to clear the cells.

    something like:

    =if(H3="anniversarydate", "cell range" = "","")

    not tested! just a thought.

    Larry
    It's a whole list of employees, so anniversary dates are all different (listed in column C next to the employee name). "Earned" vacation hours are in Column F on the summary sheet, and "Unused" vacation hours are in G. I'm using several nested If functions to calculate the earned time, and the unused time is calculated with this:
    Please Login or Register  to view this content.
    where the row is respective to each individual employee & goes every other one because each employee is dedicated 2 rows (one for date & the next for number of hours) in the detail sheet.

  11. #11
    Registered User
    Join Date
    09-11-2008
    Location
    CO
    MS-Off Ver
    Office 2007
    Posts
    40

    Re: Automatically Clear Rows When Condition Is Met

    Anniversary date would be a complete year (or x number of complete years) from the "Hire Date" in column C on the Summary sheet. On row 3 for example, the anniversary date this year would be 11/7/09, since the hire date is 11/7/07.

    I've updated my example where I added some vacation time used to the first employee, so it is now deducting on the summary sheet & showing 8 unused hours; hopefully that will give a better idea of how everything's playing together. What I need is to set it up so it will automatically reset those unused hours on 11/7 (in other words, clear the data entered for that employee on the 'Vacation Time' sheet) because they will have earned another week of vacation & their unused time doesn't carry over.

    Or maybe I'm going about this the wrong way?
    Attached Files Attached Files
    Last edited by TheLostBoy; 02-06-2009 at 02:51 PM.

  12. #12
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Automatically Clear Rows When Condition Is Met

    I've figured that out, but we need to check for an anniversary date. This will vary because of lap years and the date may not be a workday in subsequent years.

  13. #13
    Registered User
    Join Date
    09-11-2008
    Location
    CO
    MS-Off Ver
    Office 2007
    Posts
    40

    Re: Automatically Clear Rows When Condition Is Met

    Is it possible to set it to compare just the month & day of the current day vs. hire date? So if they're equal to each other regardless of year it performs the action and does nothing if they're different...

  14. #14
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Automatically Clear Rows When Condition Is Met

    I can match the week numbers using VBA, but then you have merged cells in the data sheets which make deleting the data more difficult. Are the names & rows fixed for each employee i.e. the first employee on the summary sheet will have the records in Row 5 of the data sheet?

  15. #15
    Registered User
    Join Date
    09-11-2008
    Location
    CO
    MS-Off Ver
    Office 2007
    Posts
    40

    Re: Automatically Clear Rows When Condition Is Met

    Not currently - I condensed each employee on the summary sheet to 1 row where I'm using 2 each on the detail sheets. That was the only way I could think of entering the date as well as the time used. If there's a simpler or better way of doing that while we're at it I'm definitely open to it!

  16. #16
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Automatically Clear Rows When Condition Is Met

    This should do it, add some hours to the Vacation sheet for some dates that will be anniversary and save the workbook. Open it & the hours should clear
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    09-11-2008
    Location
    CO
    MS-Off Ver
    Office 2007
    Posts
    40

    Re: Automatically Clear Rows When Condition Is Met

    That looks like it's doing what I need it to - I've added to your reputation, thank you!

    And this will not be thrown off when it comes time to add or remove employees?
    Last edited by TheLostBoy; 02-06-2009 at 05:33 PM. Reason: Figured something out on my own

  18. #18
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Automatically Clear Rows When Condition Is Met

    Thanks for the feedback, the macro should work as long as you maintain the order of names in each sheet. It matches the current week number with that entered as Hire date, this should be close enough because as i said earlier the actual anniversary may fall at a weekend and not be picked up by matching the date.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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