Hi All,
I've been trying to put together some code to hide a range of rows on one page based on cell values on a different page. So basically Sheet1 cell A1 value is 10, A2 value is 20. When macro is run via button rows on Sheet2 from 10-20 would be hidden. The issue is the values in the cells on Sheet1 will vary. I thought something like the following would work but it doesn't. Any suggestions would be a great help. Thanks.
![]()
Sub Button1_Click() Dim starta As String Dim finisha As String starta = Sheets("Sheet1").Range("A1") finisha = Sheets("Sheet1").Range("A2") Sheets("Sheet2").Range("starta" & ":" & "finisha").EntireRow.Hidden = True End Sub
Bookmarks