Ladyj205
06-05-2018, 10:15 AM
I'm using excel 2010 win 7
I have rows (18:42) which is 25 rows.
i want to use a commandbutton that use
a. two ranges:one will cover the rows starting at 18 to the last hidden row, the other will not be set
b. Use a For Each loop to go through each row in the first range using the second range as the “each” item (i.e. For Each Range2 In Range1)
c. If the row (Range2) being checked is hidden set it to shown and then exit the loop
d. If the row is already shown go to the next row (Next Range2)
so when you click the button it would show row 18 and when u click again it will show the next row while the other rows are hidden
so would my code be like
Option Explicit
Private Sub CommandButton1_Click()
Rows("18:42").Select
If Rows("18:42").Hidden =TrueThen
Selection.EntireRow.Hidden =False
Else
Selection.EntireRow.Hidden =True
EndIf
End Sub
https://unsee.cc/c831aaa4/ (https://www.mrexcel.com/forum/redirect-to/?redirect=https%3A%2F%2Funsee.cc%2Fc831aaa4%2F)
i appreciate all the help on this thanks :)
i want it to look like this https://unsee.cc/ce403f89/
I have rows (18:42) which is 25 rows.
i want to use a commandbutton that use
a. two ranges:one will cover the rows starting at 18 to the last hidden row, the other will not be set
b. Use a For Each loop to go through each row in the first range using the second range as the “each” item (i.e. For Each Range2 In Range1)
c. If the row (Range2) being checked is hidden set it to shown and then exit the loop
d. If the row is already shown go to the next row (Next Range2)
so when you click the button it would show row 18 and when u click again it will show the next row while the other rows are hidden
so would my code be like
Option Explicit
Private Sub CommandButton1_Click()
Rows("18:42").Select
If Rows("18:42").Hidden =TrueThen
Selection.EntireRow.Hidden =False
Else
Selection.EntireRow.Hidden =True
EndIf
End Sub
https://unsee.cc/c831aaa4/ (https://www.mrexcel.com/forum/redirect-to/?redirect=https%3A%2F%2Funsee.cc%2Fc831aaa4%2F)
i appreciate all the help on this thanks :)
i want it to look like this https://unsee.cc/ce403f89/