hiding rows of data

mark gardner

Board Regular
Joined
Sep 6, 2006
Messages
52
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

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

daniels012

Well-known Member
Joined
Jan 13, 2005
Messages
5,219
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
 

DRANDON

Active Member
Joined
Jun 30, 2006
Messages
268
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
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,682
Messages
5,838,784
Members
430,568
Latest member
bortey

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
Top