major help needed --timing problem

S

stevieh

Hi all,

i have currently a userform which when a user click the start butto
time the time and date appears a1/b1 respectively.in c1 an activit
appears.

When the user then clicks stop the end time date appears in d1/e1.

My question is, is it possible to press start and select an activit
and then start another activity but the program still remembers whe
you press stop for a certain activity it remembers which start time t
put the stop time to.

current is this

Private Sub ComboBox1_Change()
ComboBox1.AddItem "Setting up a new Bank"
ComboBox1.AddItem "New Account"
ComboBox1.AddItem "Change Account"
ComboBox1.AddItem "Close "
'do not hard code
End Sub

Private Sub CommandButton1_Click()

If CommandButton1.Caption = "Start" Then
CommandButton1.Caption = "Stop"
Set Rng = Cells(Rows.Count, "A").End(xlUp)(2, 1)
Rng(1, 1).Value = Date
Rng(1, 2).Value = Time
Rng(1, 3).Value = ComboBox1
Else
CommandButton1.Caption = "Start"
Set Rng = Cells(Rows.Count, "A").End(xlUp)(2, 1)
Rng(0, 4).Value = Date
Rng(0, 5).Value = Time

End If
End Sub

Private Sub CommandButton2_Click()
With Cells(65536, 4).End(xlUp).Offset(2, 1)
If IsEmpty(.Offset(0, -1)) Then
MsgBox "You forgot to push the Start Button first"
Else
.Value = Date
.Offset(0, 1).Value = Time
End If
End With
End Sub
:confused
 
D

DNF Karran

I got a bit confused by the question-

Do you want to have multiple start times and end times?
ie
select item from combo box & press start.
select new item from combo box & press start.
Select first item and press stop

You might be best setting up a separate location for storing start an
end times for each activity so things are a lot easier to follow.
ie

row 1 is for Setting up a new Bank
row 2 is for New Account
etc

Dunca
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top