hiding rows of data

mark gardner

Board Regular
Joined
Sep 6, 2006
Messages
58
I have a sheet where I have data in a row, followed by a calculation row, followed by a data row etc... (keeps alternating). I would like to know if there is a quick way to toggle those calcution rows off and on to hide them when I don't need them. I have to keep manually hiding the rows now.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
You can create a button to do this, adding some code like this:
Range("3:3,5:5,7:7,9:9,11:11,13:13,15:15,17:17").Select
Selection.EntireRow.Hidden = True

Then one to unhide them all the same way

Michael
 
Upvote 0
assign macro to a button -

sub Hide_Rows()
dim i

for i = 20 to 2 step -2 ' starts at row 20 and ends at row 2
rows(i,i).select
Selection.EntireRow.Hidden = True
next i

end sub
 
Upvote 0

Forum statistics

Threads
1,218,740
Messages
6,144,214
Members
450,531
Latest member
avril18

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