Clear cells automatically
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Const WS_RANGE As String = "F16:I16"
On Error GoTo stoppit
Application.EnableEvents = False
If Target.Address = "$E$16" And Target.Value = "" Then
Me.Range(WS_RANGE).ClearContents
End If
stoppit:
Application.EnableEvents = True
End Sub
This is worksheet event code. Right-click on the sheet tab and "View Code".
Copy/paste into that sheet module.
Alt + q to return to Excel.
Gord Dibben MS Excel MVP
On Sat, 15 Aug 2009 06:39:01 -0700, bigmaas
wrote:
E16 is a manually input date. F16:H16 is manually input text. I16 is manually
input number. When I clear E16 manually, I want to have F16:I16 cleared
automatically.
Can anyone help? Thanks
|