ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Create button to unhide rows directly below (https://www.excelbanter.com/excel-discussion-misc-queries/127050-create-button-unhide-rows-directly-below.html)

create button to unhide rows

Create button to unhide rows directly below
 
I have at subject titles that have sub information that totals into the
subject row. I want to create a button to click to open the hidden rows to
view the information in those rows.
Sounds simple!

FSt1

Create button to unhide rows directly below
 
hi,
it is. but you didn't say which rows or how many or if they vary in number.
but....from the tool box, drop a command button on your sheet. while in
design mode, right click the button. from the pop up window, select
properties.
change the name of the button to Cmd1. close the property window.
while still in design mode, right click the button again. from the popup
window, select view code. paste this code into the code window...

Private Sub Cmd1_Click()

If Rows("3:4").Hidden = True Then '<change row reference to suit your needs
Rows("3:4").Hidden = False
Cmd1.Caption = "Hide"
Else
Rows("3:4").Hidden = True
Cmd1.Caption = "Unhide"
End If

End Sub

clicking the button with hide the rows. clicking it again with unhide the
rows.

regards
FSt1
"create button to unhide rows" wrote:

I have at subject titles that have sub information that totals into the
subject row. I want to create a button to click to open the hidden rows to
view the information in those rows.
Sounds simple!



All times are GMT +1. The time now is 08:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com