Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub Worksheet_Change(ByVal Target As Range)
- Set w = ActiveSheet.Range("J4:L4")
- For Each C In w
- If C.Value <> "" And Not IsDate(C) Then
- C.ClearContents
- MsgBox "Only a Date is permitted in this cell."
- End If
- If C.Value = "" And Not IsDate(C) Then
- C.Interior.ColorIndex = 0
- Else
- C.Interior.ColorIndex = 4
- End If
- Next C
- End Sub
- Sub CopyLastCell()
- Range("J4").End(xlToRight).Copy
- Range("M4").PasteSpecial
- Application.CutCopyMode = False
- End Sub
Add Comment
Please, Sign In to add comment