help on select case

  • Thread starter Thread starter tomyboy
  • Start date Start date
T

tomyboy

we are Emmaus guys. You know ? We receive a brand new PC with Excel.
Now we need some help. What we want is a timing schedule for our job.
We think somethin like a single sheet for each of us with 6 columns
column 1 : the day date
column 2 : the time of arrival in the morning
column 3 : the lunch time departure
column 4 : the lunch time return
column 5 : the night time leaving
column 6 : total of daily working hours
we heard about one button which could insert all those informations
when ckicked (they say select case !!!)
Have no more idea than
1st click : the day and arrival time is inserted
2nd click : the lunch time departure is inserted
3rd click : the lunch return time is...
4th click : the departure time is ... and the daily hours are
calculated
the day after a new row is open for the same details and by the end of
the month we could got the total for each of our people.
Is that right ?
Many thank for all informations
Joseph/Leman Lake
 
Hi guys,

To start, put this formula in F1, and copy down as many rows as required

=MAX(0,(C1-B1))+MAX((E1-D1),0)

Then put this code in the worksheet code module. Selecting column A will
insert today's date, B-E will insert the current time. It requires
disciplined input.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Select Case Target.Column
Case 1: Target.Value = Format(Date, "dd mmm yyyy")
Case 2, 3, 4, 5: Target.Value = Format(Now, "h:mm")
End Select

End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top