Hello
I have a code in sheet1 which starts like :
Public Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A1:d7,E15:E20,E10:E13,D11:D13,D22:D27,E21")) Is Nothing Then Exit Sub
On Error GoTo clean_up
Application.ScreenUpdating = False
Application.EnableEvents = False
'and continue with many IF this ELSE ... and also hide and unhide rows etc etc
Later, I decided to put some buttons. So there is a module (module2 in my case) in which there is the code for the buttons like this (example of 1 button "backtomain") :
Sub backtomain()
ActiveSheet.Unprotect
Worksheets("Sheet1").Rows("8:29").Hidden = False
Worksheets("Sheet1").Rows("30:46").Hidden = True
ActiveWindow.ScrollRow = 1
Call Sheet1.Worksheet_Change
End Sub
But I m getting an error "Argument not optional" when I m trying to call the specific sub
What I want is to run again the sub Worksheet_Change which hide/unhide rows, after button "backtomain" pressed
Bookmarks