hide rows with macro/togglebutton

H

huntermcg

hi.

i have another question wich you could help me with.

now the code is something like:
Sub VerbergenOP1FA()
ActiveSheet.Unprotect Password:="xyz"
Rows("7:13").Hidden = Not Rows("7:13").Hidden
ActiveSheet.Protect Password:="xyz"
End Sub

This code opens the rows and close them. now i want when i open the
rows not to show all. for instance alone the rows 7:8 and 12:13. How do
I adjust this in the VBA code.

Please help.
 
S

STEVE BELL

Sounds like you just want to show Rows("9:11")
If that is it - just change your code accordingly.

Or you can insert into your code additional lines to hide
these rows.

Other wise I'll need more details on just what you want to do.
 
H

huntermcg

No. You do not really understand me.

Ex.

I have a sheet in wich from row 1 :10, row 7 and 8 are hidden. Now, I
have the command button/macro wich I use when I want to hide row 1:10
and unhide it back again when I click the button again. Only when I
click the button again to unhide the rows, also row 7 and 8 show. That
was not supposed to happen.

So, I need the code we made like this:

Sub VerbergenOP1FA()
ActiveSheet.Unprotect Password:="xyz"
Rows("1:10").Hidden = Not Rows("1:10").Hidden
ActiveSheet.Protect Password:="xyz"
End Sub

Only now with a line wich let row 7 and 8 hidden, when I want to unhide
rows 1 tot 10 again.

I hope you understand and can make it possible to adjust he coding to
this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top