Hellow,
Here is the problem; i have equations in column "B" that return a value down to Row x ( in this code to row 35). Some of the rows between B1 and B35 will be left blank. I allready have a code that works on fixed parameters, i would like to modify it so it will work on changing ranges of non blank cells. The code hides empty rows between last cell with the text and row 35
The code is :
The code works if i put in insted of M2 a value.![]()
Sub cell() Dim cell As String cell = ThisWorkbook.Sheets("1").Cells(M2, 2).Value ThisWorkbook.Sheets("1").Rows("1:35").Hidden = False If cell = "" Then ThisWorkbook.Sheets("1").Rows("M2:35").Hidden = True End If End Sub
M2 is the variable. I want the code to be able look at the sheet "1" and into cell M2 and put the value of that cell into the code.
If you want you can also write the equation from M2 directly to the code. Equation in cell M2 is = 35-COUNTBLANK(B1:B35)+1
Thank you for your help
AT
Bookmarks