Hide VBA code help

G

GerryK

My newly created workbooks (in Excel 2003) do not hide the rows as expected
with the simple vba code below. It is one that I have been using all along.

My old workbooks work fine... but something has changed. Can someone please
advise?

Could it be a version issue between older Excel and 2003?

Sub hide_it()
Columns("E:IV").Hidden = True
Rows("16:65536").Hidden = True
End Sub

Gives me the proper hidden columns but not the rows!

TIA for any help!
GerryK
 
R

Rick Rothstein \(MVP - VB\)

Rows("16:65536").Hidden = True

Using Excel 2003... this line works fine for me. It even works for me in
Excel 2007 (although it doesn't hide all the rows as Excel 2007 has more
than 65536 of them).

Rick
 
M

Mike

Maybe somthing like this

Rows("16:65536").EntireRow.Hidden = True
Columns("E:IV").EntireColumn.Hidden = True
 
G

GerryK

Thank you, however, I'm now gertting a run time 400 error when I run the Hide
It macro from the drop down!
 
Top