I want to assign sheetname (Sh) and Column range (Target) for Workbook event, when in a worksheet "main" in column B value changes run the macro Next()
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Sh = "main"
Target = Sh.Range("B:B")
Next()
End Sub
gives me an error on Sh="main"
Is it like, it will run on any cell in any column change occurs? But I need explicitly "main" sheet, column B (any cell) change event driven macro?
Is it even possible in VBA?
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Application.EnableEvents=False
Set Sh = Worksheets("main")
Set Target = Sh.Range("B:B")
Next()
Application.EnableEvents=True
End Sub
When change any cell in main Sheet subprocedure named Next runs. But, I need only changes in cells in B column when occurs only then Next subprocedure to run