+ Reply to Thread
Results 1 to 2 of 2

Excel Help - Sign In & Sign Out Form

  1. #1
    Registered User
    Join Date
    01-28-2016
    Location
    Ontario, Canada
    MS-Off Ver
    Microsoft Office 2013
    Posts
    2

    Excel Help - Sign In & Sign Out Form

    I have a userform that has a Sign In, Sign Out button. and it opens an external excel file that clocks in the current time, saves, then closes the file.
    The external file has two columns.

    Sign In Sign Out
    4/7/2016 10:21 4/10/2016 10:21:51
    4/9/2016 10:21

    However, sometimes people forget to Sign In or Sign Out on the same day... which ends up the rows dont align accordingly to the right date. i cant seem to figure out the right way to make it become:
    Same row only for the same current day, if not. then have to use a new row.
    If forget to Sign In, but remembers to Sign Out, then new row. Visa Versa.

    Here is my code for my two Sign In, Sign Out buttons:

    Private Sub SignIn_Click()
    Dim emptyRow As Long

    Workbooks.Open Filename:= _
    "C:\Users\TNYAUTO\Desktop\Login_Logout database.xlsx"

    Windows("Login_Logout database.xlsx").Activate

    Worksheets(WorkerList.Value).Activate

    emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1

    Cells(emptyRow, 1).Value = Now()

    ActiveWorkbook.Save
    ActiveWindow.Close

    End Sub


    Private Sub SignOut_Click()
    Dim emptyRow As Long
    Dim emptyRowB As Long


    Workbooks.Open Filename:= _
    "C:\Users\TNYAUTO\Desktop\Login_Logout database.xlsx"

    Windows("Login_Logout database.xlsx").Activate

    Worksheets(WorkerList.Value).Activate

    emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1
    emptyRowB = WorksheetFunction.CountA(Range("B:B")) + 1


    Cells(emptyRowB, 2).Value = Now()

    ActiveWorkbook.Save
    ActiveWindow.Close
    End Sub



    ANY HELP IS VERY MUCH APPRECIATED

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Excel Help - Sign In & Sign Out Form

    How about this for logic?

    If you have two sign ins in a row, then the person forgot to sign out. If you have two sign outs in a row, the person forgot to sign in.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

+ 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. Trying to create Sign in Sign out sheet with time stamp
    By InNeedOfHelp88 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-29-2015, 07:11 PM
  2. [SOLVED] Employee sign-in userform - Multiple sign ins?
    By Battletoads in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-16-2014, 10:57 AM
  3. Replies: 7
    Last Post: 06-17-2014, 02:15 PM
  4. Had to sign up to DL a form; however,..
    By KegSOUND in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 03-17-2013, 12:51 PM
  5. Replies: 3
    Last Post: 03-13-2013, 01:20 AM
  6. Decimal Sign Replaced with ; Sign
    By lopiner in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-10-2009, 08:47 AM
  7. XL invoice replace the dollar sign with euro sign
    By Pamela casares in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 12-16-2005, 04:25 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