Button for hiding rows - complete newb - never used Macros

tom_j

New Member
Joined
Jan 28, 2012
Messages
1
OK - don't use excel much more than the standard functions, but I do have a fairly robust to-do list that has data associated with it. What I am trying to do is creating a button (or link - does not need to be fancy) that I can put in to each row that will invoke the row-hide function. I also want to put a timer on it so it only hides it until the next day (12:01 AM)

Would love some help!
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
OK - don't use excel much more than the standard functions, but I do have a fairly robust to-do list that has data associated with it. What I am trying to do is creating a button (or link - does not need to be fancy) that I can put in to each row that will invoke the row-hide function. I also want to put a timer on it so it only hides it until the next day (12:01 AM)

Would love some help!

Here's some info you can use (for starters) to fit your needs.;)

Alt-F1
Insert/Module
Paste in the following code

Code:
Sub Macro1()
    ActiveSheet.Buttons.Add(434.25, 14.25, 65.25, 21).Select
    Selection.OnAction = "Macro2"
    ActiveSheet.Shapes(1).Select
    Selection.Characters.Text = "Hide Rows"
    [A1].Select
End Sub

Sub Macro2()
    Rows("8:8").EntireRow.Hidden = True
End Sub
Press F5 and select Macro1, if prompted.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top