Time sheet in Excel (help!)
Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A:A" '<== change to suit
Dim aryQtrs
On Error GoTo ws_exit
Application.EnableEvents = False
aryQtrs = Array("1st Qtr ", "2nd Qtr ", "3rd Qtr ", "4th Qtr ")
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If IsDate(.Value) Then
.Offset(0, 1).Value = aryQtrs(((Month(.Value) + 2) \ 3) +
(LBound(aryQtrs) = 0)) & Year(.Value)
End If
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub
'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.
--
---
HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in my addy)
"crookedsoul108" wrote in message
...
I am making a timesheet. I have most of the functions figured out. My
boss
wants the date entered to automatically enter the quarter it corresponds
with..and I don't know if excel can do that. Maybe it can? Also, if it
works
in Access, that would be okay too. Anyways, an example: if someone
entered
11/01/07 the next column should automatically enter 4th quarter 2007. If
someone enters 4/21/09, it should enter 2nd quarter 2009.
Another thing I need to do is take about 10 individual time sheets and put
them into one big database timesheet. Can I do that in Access?? Any help
is
appreciated. Thank you!
-Coralee
|