Results 1 to 8 of 8

ComboBox Time Value/Command button click update

Threaded View

hwtcrl ComboBox Time Value/Command... 04-29-2015, 06:30 PM
mehmetcik Re: ComboBox Time... 04-29-2015, 07:44 PM
LJMetzger Re: ComboBox Time... 04-29-2015, 08:04 PM
hwtcrl Re: ComboBox Time... 04-29-2015, 09:04 PM
mehmetcik Re: ComboBox Time... 04-30-2015, 12:38 PM
hwtcrl Re: ComboBox Time... 04-30-2015, 02:40 PM
LJMetzger Re: ComboBox Time... 04-30-2015, 05:32 PM
hwtcrl Re: ComboBox Time... 05-01-2015, 01:15 PM
  1. #5
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: ComboBox Time Value/Command button click update

    Ok try this:

    
    Public TN As Date, T1 As Date, TS As Date, changeflag As Boolean
    
    Private Sub ComboBox1_Change()
    If changeflag = True Then Exit Sub
    
    ComboBox1.Value = Format(ComboBox1.Value, "hh:mm:ss")
    T1 = CDate(ComboBox1.Value)
    TN = CDate(Now)
    Label3.Caption = TN + T1
    Label3 = Format(Label3, "hh:mm:ss")
    
    End Sub
    Private Sub ComboBox2_Change()
    If changeflag = True Then Exit Sub
    
    ComboBox2.Value = Format(ComboBox2.Value, "hh:mm:ss")
    T1 = CDate(ComboBox2.Value)
    TN = CDate(Now)
    Label4.Caption = TN + T1
    Label4 = Format(Label4, "hh:mm:ss")
    
    End Sub
    Private Sub ComboBox3_Change()
    If changeflag = True Then Exit Sub
    
    ComboBox3.Value = Format(ComboBox3.Value, "hh:mm:ss")
    
    T1 = CDate(ComboBox3.Value)
    TN = CDate(Now)
    Label5.Caption = TN + T1
    Label5 = Format(Label5, "hh:mm:ss")
    
    End Sub
    Private Sub CommandButton1_Click()
    changeflag = True
    
    ComboBox3.Value = ComboBox2.Value
    ComboBox2.Value = ComboBox1.Value
    ComboBox1.Value = Format(Now, "hh:mm:ss")
    changeflag = False
    End Sub
    Attached Files Attached Files
    Last edited by mehmetcik; 04-30-2015 at 01:09 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. use a command button to click other command buttons
    By fcharl9 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-20-2013, 08:48 PM
  2. Automatically update existing data using a Update command button
    By 9999335 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-23-2012, 09:46 PM
  3. UserForm, update after command button click
    By ker9 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-01-2010, 01:05 PM
  4. VBA Click Command Button
    By Benz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-04-2006, 04:30 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