Consulting

Results 1 to 6 of 6

Thread: Hidden sheet in vba form excel vlookup

  1. #1
    VBAX Newbie
    Joined
    Nov 2015
    Posts
    3
    Location

    Unhappy Hidden sheet in vba form excel vlookup

    I am trying to create a log in log out form using excel vba.

    1. If I hide the DATA sheet, and I enter the employee ID which is available. its giving me employee not available.
    2. If I arrange the position of the sheets (put tracker first then data), its giving me error message.
    3. I also want to that each time the employee click submit, it will ask for a password. if the password is correct, it will then do time stamp for log out or log in.
    4. Also, In the tracker sheet. I put a column for the total number of hours. (I want this automatic if log in and log out time is filled in).

    Please help me.
    Attached Files Attached Files

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Use

    [vba]
    Set myrange = Worksheets("DATA").Range("A:C")[/vba]

    rather than just

    [vba]
    Set myrange = Range("A:C")[/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Newbie
    Joined
    Nov 2015
    Posts
    3
    Location
    So, if i use that way. I can hide and change the position of the sheet? It wont give me error anymore?

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    It was something clearly wrong that jumped out at me, it might solve all problems, but it may highlight another. Why don't you try it and see.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Newbie
    Joined
    Nov 2015
    Posts
    3
    Location
    Its working now, Thanks. I have another question and I think this would be the last. Saving the data is now working. But what gives me headache right now is, for the log out. What I wants is after they logged in, and I enter again the employee id. It should find the last transaction made and will time stamp for log out.

    hope you can help me with this.

    Thank you in advance

  6. #6
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    In the ThisWorkbook Code Page
    Option Explicit
    
    Dim TransActionTime As Date
    
    
    Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
      TransActionTime = Now
    End Sub
    
    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Worksheets("DATA").Range("Whatever") = TransActionTime
    Me.Save
    'Or
    'Me.SaveAs
    End Sub
    
    'AND... OR
    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    Worksheets("DATA").Range("Whatever") = TransActionTime
    End Sub
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •