+ Reply to Thread
Results 1 to 9 of 9

Visitor log macro

  1. #1
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Visitor log macro

    Hi, I'm trying to make an excel based visitor log book whereby visitors would scan their identification card when they come in and the details would be logged. There are some questions which I hope can be answered.

    1) How do I code it such that when an ID that exist in the lookup tab is scanned in textbox1, the name of the ID holder would appear in textbox2?
    2) If an ID and name that does not exist in the lookup tab, that particular ID and name would be added to the lookup list after signing in for future visits?
    3) The code I have now logs a time in in column D, how do I code it such that when a person who has signed it scans the ID again, it will log that person out and generate a date/time out in column E?

    Have attached the workbook for reference
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor meabrams's Avatar
    Join Date
    10-03-2014
    Location
    USA
    MS-Off Ver
    2007, 2010, 2013, 2016
    Posts
    451

    Re: Visitor log macro

    I think this is long the lines of what you want… It is currently set to lookup the information after 6 digits is entered/scanned in. I set 2 different named ranges for the look up of the name and to look and see if they are already signed in. Please let me know if this works for you!
    Attached Files Attached Files
    Bramz

  3. #3
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: Visitor log macro

    Hi meabrams, thanks for your help!! it works the way I hope it would. Would you be able to help with question 2? I keyed in a number that does not exist in the lookup tab, and after signing in, the data is not captured in the lookup tab

  4. #4
    Valued Forum Contributor meabrams's Avatar
    Join Date
    10-03-2014
    Location
    USA
    MS-Off Ver
    2007, 2010, 2013, 2016
    Posts
    451

    Re: Visitor log macro

    Cant believe I missed step 2 and went straight to step 3 but this should work the way you need it to
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: Visitor log macro

    Ah Thank you so much. Can you please help me with 1 last question? I have a status textbox in the form. What I hope to have inside is, for example, Ben is already signed in and when you scan his ID number again, the status textbox would have the message "Ben was signed in on/at (column D value)". This is so that users who administers the signing in process knows whether this person is signing in or out.

  6. #6
    Valued Forum Contributor meabrams's Avatar
    Join Date
    10-03-2014
    Location
    USA
    MS-Off Ver
    2007, 2010, 2013, 2016
    Posts
    451

    Re: Visitor log macro

    Im confused at what you are wanting… As of right now it inserts date/time in column D when they scan in then when they scan out it inserts the date/time in column E without updating column D information. Are you wanting the information to be replaced on the in log with signed out or are you wanting a separate column to be added that gives in or out status information. Do you want the status box to even be clickable? Need a bit more information so I can make the changes to this in order to have this working properly for you

  7. #7
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,522

    Re: Visitor log macro

    Try it this way.
    Attached Files Attached Files
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  8. #8
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: Visitor log macro

    Hi meabrams, sorry for being unable to convey my intentions. The status textbox is to show the user if a visitor is signing in or signing out. If signing out, then the status box would display when did the visitor signed in. The purpose is to know which visitors coming and which are going.

    Thank you bakerman for the contribution

    You 2 have been a great help to me

  9. #9
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,522

    Re: Visitor log macro

    You're welcome and thanks for adding rep points.

+ 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. [SOLVED] The last 10 visitor(s) & ”friends request”
    By Alf in forum Suggestions for Improvement
    Replies: 4
    Last Post: 08-25-2013, 02:21 PM

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