Hi all,
I am trying to run a simple bit of script but keep getting an error and Excel becomes non responsive. I have a 3rd party program inputting data into a sheet every 1 second, and when cell "A2" = "Next" i would like the contents of a certain range to be cleared. I am using Excel 2007.
Many thanks in advance
I am trying to run a simple bit of script but keep getting an error and Excel becomes non responsive. I have a 3rd party program inputting data into a sheet every 1 second, and when cell "A2" = "Next" i would like the contents of a certain range to be cleared. I am using Excel 2007.
Many thanks in advance
Code:
Private Sub Worksheet_Calculate()
If Sheet3.Cells(2, 1) = "Next" Then
Range("L4:R6").Select
Selection.ClearContents
Range("L8:R500").Select
Selection.ClearContents
End If