Chris Turner
New Member
I have a worksheet that has data entered into cells A1 to B30. The cells C1 to C30 contains formulas to calculate the difference between two data points e.g A1 to B1, A2 to B2, etc. down the columns A30 to B30
I am trying to create a macro that will clear cells A1 to B30 when data is entered into cell B30. After clearing the cells, the cursor should move back up to cell A1 to allow me to start the data entry cycle again. I would also like to only allow data to be entered into cells A1 to B30 and stop any other cells in the worksheet from being used.
I have been working with this macro to clear the contents but would like to automate the process instead of using a button to activate the macro:
Sub sbClearCellsOnlyData()
Range("A1:C30").ClearContents
End Sub
Appreciate any help. Thanks
I am trying to create a macro that will clear cells A1 to B30 when data is entered into cell B30. After clearing the cells, the cursor should move back up to cell A1 to allow me to start the data entry cycle again. I would also like to only allow data to be entered into cells A1 to B30 and stop any other cells in the worksheet from being used.
I have been working with this macro to clear the contents but would like to automate the process instead of using a button to activate the macro:
Sub sbClearCellsOnlyData()
Range("A1:C30").ClearContents
End Sub
Appreciate any help. Thanks