Hello. New to the MrExcel.
I'm currently building a form that requires separate instances of cells being cleared based on cells from other worksheets changing.
As I understand moving to the workbook level and opening a module is necessary for multiple sheet references. However, I being a VBA newbie can't seem to figure it out.
Eventually I would lock and unlock certain cells, as well as have a reset button.
Any help would be greatly appreciated.
I'm currently building a form that requires separate instances of cells being cleared based on cells from other worksheets changing.
Code:
Private Sub Worksheet_Change(ByVal Target As Range) 'When E1 changes, E2 clears, and c20, d20 .... j20 all clear.
If Target.Address(0, 0) = "E1" Then Range("E2").ClearContents
If Target.Address(0, 0) = "K7" Then Range("L7").ClearContents
If Target.Address(0, 0) = "K8" Then Range("L8").ClearContents
End Sub
As I understand moving to the workbook level and opening a module is necessary for multiple sheet references. However, I being a VBA newbie can't seem to figure it out.
Code:
Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(0, 0) = Worksheets("Sheet15").Range("I16") Then Range Worksheets("Sheet1")("B5").Clear.Contents
End Sub
Eventually I would lock and unlock certain cells, as well as have a reset button.
Any help would be greatly appreciated.