Posts by YorkieYYZ

    I have some coding that does a countdown, however, it does the first second then doesn't show the countdown from then on. It only counts down when I close down and open again....not that helpful!!!


    Is there a way to keep the countdown running? (I know it is running in the background).


    Here is some of the code I am using.


    Code below:



    _____________________________________________________________

    Code
    Private Sub CommandButton1_Click()
    Range("N2").Value = Now
    End Sub


    __________________________________________________________________
    In cell Q1 I have this formula


    =N1+P1-NOW()


    Cell N1 has the date and time in this format: dd/mm/yyyy h:mm
    ___________________________________________________________________
    And I have 2 macros that has this:


    Macro 1:


    Code
    Range("P1").Select
    
    
    ActiveCell.FormulaR1C1 = "12:01:00 AM"
    Range("P2").Select


    ___________________________________________________________________
    Macro 2:


    Code
    Application.Run "timer.xltm!sheet_calc"


    Very messy I know, is there a better way?


    Thanks.

    Help. I need help/advice to delete the password portion of this code.


    Thanks.


    Re: ComboBox Code issues


    Thanks for your response, I didn't get an auto notification email to your reponse so haven't got back to you.


    I just tried it and there is a compile error "Else without If"


    any thoughts?


    Yorkie


    PS will try to close down old thread.

    ***RePost using correct formatting??***


    I have a code as seen below. It works great. However I am trying to add an error message if the ComboBox1 is blank "Please choose a partner name". (like the DropDownName). I really don't know how to add it without getting IF, DO type messages...can anyone see the error of my ways????


    This is my userform:[ATTACH=CONFIG]62637[/ATTACH]



    PS the...... Strp = "Punched in at " & Now
    MsgBox (Strp)
    ....does not need to be in code if causes a problem.


    Thanks, Yorkie



    Code
    Private Sub ComboBox1_Change()
    
    
    End Sub


    Code
    Private Sub NameDropDown_Change()
    
    
    End Sub


    Code
    Private Sub PasswordTextBox_Change()
    
    
    End Sub

    [INDENT]I have an amended code as seen below. However I am trying to add an error message if the ComBox1 is blank. (like the DropDownName). I really don't know how to add it without getting IF, DO type messages...can anyone see the error of my ways????


    PS the...... Strp = "Punched in at " & Now
    MsgBox (Strp)
    ....does not need to be in code if causes a problem.


    Thanks, Yorkie


    Private Sub ComboBox1_Change()


    End Sub



    Private Sub NameDropDown_Change()


    End Sub


    Private Sub PasswordTextBox_Change()


    End Sub


    Private Sub PunchIn_Click()
    'This is the sub to record the time when punching in. It records the data on the "Data Sheet" Sheet
    'The "Data Sheet" sheet also has the usernames and passwords of the users
    Dim Counter As Double
    Dim Strp As String
    Dim Found As Boolean
    Dim strPassword As String
    Me.Hide
    strPassword = PasswordTextBox.Text
    strPassword = StrConv(strPassword, vbLowerCase)
    'Find their Username on the List
    Counter = 0
    Found = False
    Do Until Found = True
    Counter = Counter + 1
    If Sheets("Data Sheet").Range("Table1[[#Headers],[Names]]").Offset(Counter, 0) = NameDropDown.Text Then
    Found = True
    End If
    'Error if the name is not on the list
    If Sheets("Data Sheet").Range("Table1[[#Headers],[Names]]").Offset(Counter, 0) = "" Then
    MsgBox ("Name is not in list. Please Select a name from the dropdown menu or add your name to the list.")
    Unload Me
    Call ShowPunchIn
    Exit Sub
    End If
    Loop
    'Check to see if password matches
    If Sheets("Data Sheet").Range("Table1[[#Headers],[Names]]").Offset(Counter, 1) = strPassword Then
    Found = False
    Counter = 1
    Do Until Found = True
    'Enter in the time and save
    If Sheets("Data Sheet").Range("b2").Offset(Counter, 0) = "" Then
    Sheets("Data Sheet").Range("b2").Offset(Counter, 0).NumberFormat = "@"
    Sheets("Data Sheet").Range("b2").Offset(Counter, 0) = NameDropDown.Text
    Sheets("Data Sheet").Range("b2").Offset(Counter, 1) = Now
    Sheets("Data Sheet").Range("b2").Offset(Counter, 4) = NameDropDown.Text
    Found = True
    Strp = "Punched in at " & Now
    MsgBox (Strp)
    ActiveWorkbook.Save
    Else
    'If there is an error, then notify
    If Sheets("Data Sheet").Range("b2").Offset(Counter, 0) = NameDropDown.Text Then
    If Sheets("Data Sheet").Range("b2").Offset(Counter, 2) = "" Then
    MsgBox ("You May Have Not Clocked Out. Please Talk to Your Supervisor to Fix the Error.")
    Found = True
    Unload Me
    Call ShowPunchIn
    Exit Sub
    End If
    End If
    End If
    Counter = Counter + 1
    Loop
    Else: MsgBox ("Incorrect Password")
    End If


    Unload Me



    End Sub [/INDENT]