How to hide the particular row when a button is clicked using macros

kailashramuu

New Member
Joined
May 3, 2011
Messages
13
Hi,

How to hide the particular rows in a sheet when the button is clicked using macros....



Can anyone help me on this,....


Regards
Kailash
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Are you trying to hide particular data or particular rows. If you just hide the row then if anyone inserts/deletes a row above the row that you hide, that data will no longer be hidden.
However if you highlight the actual data you want to hide (keeping in mind that the entire row will still be hidden) and define that particular range (insert - Name - Define) then you can hide it using:
Code:
Sheets("Sheet_Name").Range("Name_of_Range").EntireRow.Hidden = Sheets("Sheet_Name").Togglebutton1.value (if using a toggle button)

Otherwise if you just want the row hidden its:
Code:
Sheets("Sheet_Name").Range("1:2").EntireRow.Hidden = Sheets("Sheet_Name").Togglebutton1.Value
 
Upvote 0

Forum statistics

Threads
1,224,613
Messages
6,179,894
Members
452,948
Latest member
Dupuhini

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