+ Reply to Thread
Results 1 to 6 of 6

Need to create a attendance log using Excel

  1. #1
    Registered User
    Join Date
    09-22-2017
    Location
    United States
    MS-Off Ver
    Ms Office 2016
    Posts
    4

    Need to create a attendance log using Excel

    Hi,
    I am trying to create an attendance log using Excel but I can't figure out how to do it. I have a a ID Card reader that I need to use to get the data about who it is. The Id Card reader is pretty easy to use,I plug it into the computer and open Excel then whenever some one swipes it, the data is sent to an individual cell. Working with that, whenever some one swipes it, I need the ID number, date, time stamp, Statue IN or OUT.
    IN means that when they swipe the first time the statue is IN and OUT meaning when they swipe with the same data again the status should be OUT. Also I need a time stamp for both IN and OUT.
    For what I have right now. Right now in the excel file, as long as the A2 cells is not blank (once there is any kind of data in the A2 cell and I press enter), I will get a time stamp, date, and the statue IN but I can't figure out get status OUT (check the A columns for the same value so I can change the status to OUT (in a different row or column). ). Thank you for any kind of assistance.
    Last edited by freak5620; 09-22-2017 at 07:22 PM.

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Need to create a attendance log using Excel

    .
    Here are two projects you might be able to use to get started with. I've not utilized a CARD READER so won't be of any assistance to you.
    However, if you can get the card data to populate the correct fields, shouldn't be a problem ?

    This is only one example macro. There are two projects attached :

    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Valued Forum Contributor Maudibe's Avatar
    Join Date
    12-21-2016
    Location
    USA
    MS-Off Ver
    2010-2013
    Posts
    326

    Re: Need to create a attendance log using Excel

    Hi Freak,

    I write a lot of code for bar code scanning. A bar code scanner is the same as a card reader in that they are input devices that enter characters into a cell one character at a time. Unfortunately, there is no event for a cell as the characters are being entered, only after the selection moves to another cell is the change event fired. This is OK if you want to hit enter or click another cell after every swipe.

    The better approach is to use a userform with a textbox that will receive the ID. A textbox has a KEYUP event that can count and analyze the characters as they are being input. The userform's modal property is set to false so that it can stay open while you perform other tasks if needed, such as erase an entry, and still monitor for a read from the card reader.

    Here is how it works:
    1. The code is set to look for IDs of a certain length, ex. all IDs have 5 characters bit this can easily be change to any length
    2. Since the textbox retains the focus, all reads from the cardreader are dumped into the textbox one character at a time. Each character entered triggers the textbox's keyup event.
    3. The textbox KeyUp event analyzes the length of the ID as each character is inputted and when that condition is met, the code performs an action.
    4. The code compares the entered ID to count how many instances there are in column A. Base on what it finds, actions are performed based on the following scenarios

    Scenario 1: No instances are found (Unique)- the ID is placed in col A and it is assumed that this therefor is a swipe in so the date and time are stamped in the in columns
    Scenario 2: 1 or more instances are found- The code finds the last instance and determines if there was a swipe in and a swipe out. If there is a swipe in but no swipe out then the swipe out columns are stamped with a date and time. If there is both a swipe in and a swipe out then the code creates a new entry line placing the ID and a swipe in

    The logic is fairly simple but manipulating the input of the characters to elicit an event with no user intervention is the trick.

    Here is the code
    In the user form module, place the following code:
    Please Login or Register  to view this content.
    CardReade1.png

    CardReader.xlsm
    Last edited by Maudibe; 09-23-2017 at 10:15 AM.

  4. #4
    Registered User
    Join Date
    09-22-2017
    Location
    United States
    MS-Off Ver
    Ms Office 2016
    Posts
    4

    Re: Need to create a attendance log using Excel

    Thank you so much for your assistance! I really appreciate your help and your time but I have never used the macro functionality. I wanted this excel sheet to be function based so I don't need to know Macro.
    As for the Id Card reader, it is a simple device which only uses excel sheets to store any incoming data.

    Here's the file
    Attendace Log Trail.xlsx

  5. #5
    Registered User
    Join Date
    09-22-2017
    Location
    United States
    MS-Off Ver
    Ms Office 2016
    Posts
    4

    Re: Need to create a attendance log using Excel

    Quote Originally Posted by Logit View Post
    .
    Here are two projects you might be able to use to get started with. I've not utilized a CARD READER so won't be of any assistance to you.
    However, if you can get the card data to populate the correct fields, shouldn't be a problem ?

    This is only one example macro. There are two projects attached :

    Please Login or Register  to view this content.

    Thank you so much for your assistance! I really appreciate your help and your time but I have never used the macro functionality. I wanted this excel sheet to be function based so I won't need to know Macro. I also want everyone who is not familiar with excel to be able uses this.
    As for the Id Card reader, it is a simple device which only uses excel sheets to store any incoming data. You can just ignore it. Basically, it's automatically fill data for a cell that and moves down(so no need to press enter).

    Here's what I have so far. (if you fill data any cell of A column and press enter )
    Attendace Log Trail.xlsx

  6. #6
    Registered User
    Join Date
    09-22-2017
    Location
    United States
    MS-Off Ver
    Ms Office 2016
    Posts
    4

    Re: Need to create a attendance log using Excel

    Quote Originally Posted by Maudibe View Post
    Hi Freak,

    I write a lot of code for bar code scanning. A bar code scanner is the same as a card reader in that they are input devices that enter characters into a cell one character at a time. Unfortunately, there is no event for a cell as the characters are being entered, only after the selection moves to another cell is the change event fired. This is OK if you want to hit enter or click another cell after every swipe.

    The better approach is to use a userform with a textbox that will receive the ID. A textbox has a KEYUP event that can count and analyze the characters as they are being input. The userform's modal property is set to false so that it can stay open while you perform other tasks if needed, such as erase an entry, and still monitor for a read from the card reader.

    Here is how it works:
    1. The code is set to look for IDs of a certain length, ex. all IDs have 5 characters bit this can easily be change to any length
    2. Since the textbox retains the focus, all reads from the cardreader are dumped into the textbox one character at a time. Each character entered triggers the textbox's keyup event.
    3. The textbox KeyUp event analyzes the length of the ID as each character is inputted and when that condition is met, the code performs an action.
    4. The code compares the entered ID to count how many instances there are in column A. Base on what it finds, actions are performed based on the following scenarios

    Scenario 1: No instances are found (Unique)- the ID is placed in col A and it is assumed that this therefor is a swipe in so the date and time are stamped in the in columns
    Scenario 2: 1 or more instances are found- The code finds the last instance and determines if there was a swipe in and a swipe out. If there is a swipe in but no swipe out then the swipe out columns are stamped with a date and time. If there is both a swipe in and a swipe out then the code creates a new entry line placing the ID and a swipe in

    The logic is fairly simple but manipulating the input of the characters to elicit an event with no user intervention is the trick.

    Here is the code
    In the user form module, place the following code:
    Please Login or Register  to view this content.
    Attachment 539489

    Attachment 539491

    Thank you so much for your assistance! The ID card reader does automatically enter itself. After any card is swiped, it records the data on a cell and automatically moves down(essentially pressing the enter key). As I have said before on other comments, I don't know any of Marco or Code related to excel at all. I also barely understand the functions (all the thing I have got was found online but I changed a little bit).

    Here's the file I have (there might be some useless codes on E or F columns . Please let me know if i can clarify any thing that's there. Thank You again !
    Attendace Log Trail.xlsx

+ 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. create formula or udf to Get the attendance& Leaves
    By leprince2007 in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 03-14-2017, 08:40 AM
  2. [SOLVED] Create Attendance Report using Lists of Participants
    By CWatsonJr in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 05-28-2015, 09:07 PM
  3. create employee attendance annual summary sheet
    By Giri.hb in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 10-31-2014, 09:24 AM
  4. Replies: 9
    Last Post: 10-11-2014, 12:29 PM
  5. Create automated attendance with login Name?
    By marc5354 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-15-2014, 06:46 AM
  6. URGENTLY need a code to create a Attendance report.
    By raghavnrrp in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-14-2012, 06:17 AM
  7. [SOLVED] how do I create a attendance sheets?
    By Girl in transition in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 04-07-2006, 10:00 AM

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