Frncis
Member
I have a workbook to assist staff in tracking their vacation & sick time. The workbook consists of 2 worksheets. Sheet # 1 is labeled Annual Leave Record, sheet 2 is labeled Sick Leave Record. The listed code is a module that is coded on sheet 1 (provided by Marc L). It does copy the letter H (Holliday), but does not allow any numeric entries on the sheets.
The only thing that sheet 1 & 2 have in common is the letter “H”. The numeric entries can be anything from .25 to 8. The 2 sheets are independent of each other, regarding the numeric entries. Meaning that when an entry is made on 1 sheet, it does not copy to the other.
I have attached a sanitized version of the work book.
The only thing that sheet 1 & 2 have in common is the letter “H”. The numeric entries can be anything from .25 to 8. The 2 sheets are independent of each other, regarding the numeric entries. Meaning that when an entry is made on 1 sheet, it does not copy to the other.
I have attached a sanitized version of the work book.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count = 1 And Not Intersect([D4:Q29], Target) Is Nothing And Not Target.HasFormula Then
S$ = UCase$(Left$(Target.Value2, 1))
If S > "" Then
Application.EnableEvents = False
If S <> "H" Then Beep: Target.ClearContents Else Target.Value2 = S: Sheet2.Range(Target.Address).Value2 = S
Application.EnableEvents = True
End If
End If
End Sub