By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 1,302 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

create a button in excel to hide/unhide rows when clicked.

nev
100+
P: 251
first of all, i'm not sure if this is the correct forum to post this question. please move if ever. the reason i placed it here is because you can create visual basic code in excel.

i don't know how to do this but i think it is possible. i can place a button on my excel sheet but i don't know how to code it so that when clicked, it can toggle hide/unhide of rows 3 to 5.

does anyone know how to do this? can you supply me the simple code? thank you.
Feb 5 '08 #1
Share this Question
Share on Google+
2 Replies


P: 58
Keep the button away from rows 3 to rows 5.
Assign the the following macro to the button...
'--
Sub TakingTurns()
Rows("3:5").Hidden = Not Rows("3:5").Hidden
End Sub
'--

first of all, i'm not sure if this is the correct forum to post this question. please move if ever. the reason i placed it here is because you can create visual basic code in excel.

i don't know how to do this but i think it is possible. i can place a button on my excel sheet but i don't know how to code it so that when clicked, it can toggle hide/unhide of rows 3 to 5.

does anyone know how to do this? can you supply me the simple code? thank you.
Feb 5 '08 #2

nev
100+
P: 251
nev
Keep the button away from rows 3 to rows 5.
Assign the the following macro to the button...
'--
Sub TakingTurns()
Rows("3:5").Hidden = Not Rows("3:5").Hidden
End Sub
'--
i'll try it. thank you :-)
Feb 5 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.