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

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
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,214,965
Messages
6,122,499
Members
449,089
Latest member
Raviguru

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