ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Hide VBA code help (https://www.excelbanter.com/excel-worksheet-functions/144622-hide-vba-code-help.html)

GerryK

Hide VBA code help
 
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


Rick Rothstein \(MVP - VB\)

Hide VBA code help
 
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


Mike

Hide VBA code help
 
Maybe somthing like this

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

"GerryK" wrote:

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


GerryK

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

"Rick Rothstein (MVP - VB)" wrote:

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




All times are GMT +1. The time now is 12:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com