+ Reply to Thread
Results 1 to 29 of 29

VB and Excel Attendance BADLY NEEDED HELP. :(

  1. #1
    Registered User
    Join Date
    05-21-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    71

    VB and Excel Attendance BADLY NEEDED HELP. :(

    Hi guys.

    I really need help regarding biometrics attendance using vb and excel..
    We used biometrics in our office for attendance. Attach is the Raw log in and log out sample of the employees that is exported on Microsoft Excel.
    attendance.JPG

    What I need to do is through the exported Microsoft Excel file that contains the log-in and log.out, I need to extract the First Log in and Last Log out of every employee regardless of the schedule.

    Because there are employees who log-in or log-out twice or thrice.

    It will be placed on another excel sheet which contains the name, log-in and log out time.

    Employees have different schedules, there are 6am-2pm, 2pm-10pm, 10pm-6am, 5pm-1am 9am-5pm depending on what account they belong.

    I hope you can help me on this.

    Please help me.

    Thank you so much..

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: VB and Excel Attendance BADLY NEEDED HELP. :(

    blueswan,

    Attached is an example file based on the criteria you described.
    In column E is the unique list of Names.
    In column F is a formula to get the C/In times
    In column G is a formula to get the C/Out times

    In cell F2 (first clock-in time):
    Please Login or Register  to view this content.


    In cell G2 (last clock-out time):
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    05-21-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: VB and Excel Attendance BADLY NEEDED HELP. :(

    thank you so much tigeravatar! your reply helps me a lot.. can you help me translate the excel code to vba?

  4. #4
    Registered User
    Join Date
    05-21-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: VB and Excel Attendance BADLY NEEDED HELP. :(

    up! more help please!

  5. #5
    Registered User
    Join Date
    05-21-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: VB and Excel Attendance BADLY NEEDED HELP. :(

    up ! up! more help please!

  6. #6
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: VB and Excel Attendance BADLY NEEDED HELP. :(

    blueswan,

    VBA version:
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    05-21-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: VB and Excel Attendance BADLY NEEDED HELP. :(

    You're an angel in disguise, tigeravatar! I just wanted to ask if the code is applicable to the excel file you sent earlier? or you tried the code on another excel file? I will send an excel file, which contains the data. Thank you so much for the help you extended. sample2.xlsx

  8. #8
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: VB and Excel Attendance BADLY NEEDED HELP. :(

    it is not applicable to the excel file i posted earlier because the excel file i posted only has 1 name in it. The code assumes there will be more than 1 name.

  9. #9
    Registered User
    Join Date
    05-21-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: VB and Excel Attendance BADLY NEEDED HELP. :(

    Ok.. Will it be applicable to this excel file attach on this reply? sample2.xlsx thanks again!

  10. #10
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: VB and Excel Attendance BADLY NEEDED HELP. :(

    blueswan,

    Attached is a modified version of your sample workbook. It contains a button named 'Get Times' that has been assigned to the following macro:
    Please Login or Register  to view this content.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    05-21-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: VB and Excel Attendance BADLY NEEDED HELP. :(

    Its working tigeravatar! Thank you so much! But my problem now is how will i use the module if I open another sheet?

  12. #12
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: VB and Excel Attendance BADLY NEEDED HELP. :(

    How to use a macro:
    1. Make a copy of the workbook the macro will be run on
      • Always run new code on a workbook copy, just in case the code doesn't run smoothly
      • This is especially true of any code that deletes anything
    2. In the copied workbook, press ALT+F11 to open the Visual Basic Editor
    3. Insert | Module
    4. Copy the provided code and paste into the module
    5. Close the Visual Basic Editor
    6. In Excel, press ALT+F8 to bring up the list of available macros to run
    7. Double-click the desired macro (I named this one tgr)

  13. #13
    Registered User
    Join Date
    05-21-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: VB and Excel Attendance BADLY NEEDED HELP. :(

    Its working tigeravatar! Thank you so much! But my problem now is how will i use the module if I open another sheet? Will the Get Times button automatically appear if I copy and paste the module on another sheet? Sorry for having so many questions.

  14. #14
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: VB and Excel Attendance BADLY NEEDED HELP. :(

    No, the button will not appear. if you want the button, you'd have to add that manually, although it would not be necessary because you could just ALT+F8 and double-click the macro

  15. #15
    Registered User
    Join Date
    05-21-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: VB and Excel Attendance BADLY NEEDED HELP. :(

    Thank you so much tigeravatar! I am worried for the past few days because of this problem but not anymore now because of the help you extended! If I have some problems again with the codes, can I still ask for your help? Would that be alright?

  16. #16
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: VB and Excel Attendance BADLY NEEDED HELP. :(

    If the problem is related to this specific question and provided answer, then yes, that would be alright. Otherwise i would recommend starting a new thread with a new question

  17. #17
    Registered User
    Join Date
    05-21-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: VB and Excel Attendance BADLY NEEDED HELP. :(

    no problem with that! thank you again! another question tigeravatar, if I ever I wanted to know if whose late based on the extracted data, would that be possible?

  18. #18
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: VB and Excel Attendance BADLY NEEDED HELP. :(

    Yes that would be possible, and it would be simplest with conditional formatting. However, that is a question that will require a different answer after the macro I've provided has been run. I would recommend starting a new thread for that question.

  19. #19
    Registered User
    Join Date
    05-21-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: VB and Excel Attendance BADLY NEEDED HELP. :(

    ok.. i will do.. but going back to this topic, what if, there will be different dates tiger avatar? because i tried the module on data from may 15-may 17 which having different dates, the result is may 15 log.in and may 17 log.out. It should be may 15 log.in and log.out.. and may 16 log.in and log.out and may 17 log.in and log.out and so on .please see attach file. testing.xlsx hope you will still help me with this. thank you so much..

  20. #20
    Registered User
    Join Date
    05-21-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: VB and Excel Attendance BADLY NEEDED HELP. :(

    up! up! up!

  21. #21
    Registered User
    Join Date
    05-21-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: VB and Excel Attendance BADLY NEEDED HELP. :(

    please help!

  22. #22
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: VB and Excel Attendance BADLY NEEDED HELP. :(

    Atached is a modified version of your testing workbook. The button is assigned to the following macro:
    Please Login or Register  to view this content.


    By the way, constant bumping only deters people from posting, it does not encourage it. Please refrain from bumping more than once every 24 hours.
    Attached Files Attached Files

  23. #23
    Registered User
    Join Date
    05-21-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: VB and Excel Attendance BADLY NEEDED HELP. :(

    Thanks tigeravatar! I opened the file. The clock in and clock out for all the employees were all the same but it should be not the same because they do have different schedules and the log in and log out were not the same..

  24. #24
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: VB and Excel Attendance BADLY NEEDED HELP. :(

    I found that error also. Here is the corrected code:
    Please Login or Register  to view this content.

  25. #25
    Registered User
    Join Date
    05-21-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: VB and Excel Attendance BADLY NEEDED HELP. :(

    Wow! It works perfectly! Thank you so much tigeravatar! My problem is solved! I will now close this thread! Again, thank you!

  26. #26
    Registered User
    Join Date
    05-31-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: VB and Excel Attendance BADLY NEEDED HELP. :(

    ok..no worries
    Last edited by virgolady; 05-31-2012 at 08:58 AM.

  27. #27
    Registered User
    Join Date
    05-21-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: VB and Excel Attendance BADLY NEEDED HELP. :(

    Hi tigeravatar. I have another problem regarding extracting or copying of data from one sheet to another sheet. Here's the link of the new thread I posted. I hoped you can help me.

    http://www.excelforum.com/excel-prog...nce-in-vb.html

  28. #28
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: VB and Excel Attendance BADLY NEEDED HELP. :(

    blueswan, looks like watersev is working on that one. He's very capable and will be able to assist you
    Also, virgolady posted a practically identical thread to which I have already responded.

  29. #29
    Registered User
    Join Date
    05-21-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: VB and Excel Attendance BADLY NEEDED HELP. :(

    hi tigeravatar.. i hope you could help me on this new problem i posted.. here's the link of the thread http://www.excelforum.com/excel-prog...ch-in-vba.html

+ 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