Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Unhide rows error

I am running the following macro:

Sub open1()

ActiveSheet.Unprotect Password:="password"
ActiveWindow.DisplayHeadings = True
Columns.Hidden = False
Rows.Hidden = False
ActiveWorkbook.Unprotect Password:="password"
Sheets("sheet1").Visible = True
Sheets("sheet2").Visible = True
Sheets("sheet3").Select
Range("P3").Select

The problem that I am having is when the macro gets to "Rows.Hidden =
False," it corrupts the data in column L in sheet3 & I don't have a clue as
to why. Help!

Thanks in advance, Montana
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Unhide rows error

You should be specifying which rows are to be hidden, such as

Rows("3:7").Hidden = False


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Montana" wrote in message
...
I am running the following macro:

Sub open1()

ActiveSheet.Unprotect Password:="password"
ActiveWindow.DisplayHeadings = True
Columns.Hidden = False
Rows.Hidden = False
ActiveWorkbook.Unprotect Password:="password"
Sheets("sheet1").Visible = True
Sheets("sheet2").Visible = True
Sheets("sheet3").Select
Range("P3").Select

The problem that I am having is when the macro gets to "Rows.Hidden =
False," it corrupts the data in column L in sheet3 & I don't have a clue
as
to why. Help!

Thanks in advance, Montana



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Unhide rows error

Ok, I tried that. here's the new code:

ActiveSheet.Unprotect Password:="password"
ActiveWindow.DisplayHeadings = True
Columns("Y:IV").Hidden = False
Rows("31:65536").Hidden = False
ActiveWorkbook.Unprotect Password:="password"
Sheets("Sheet1").Visible = True
Sheets("Sheet2").Visible = True
Sheets("Sheet3").Select
Range("P3").Select

Now I get the error message when I run the macro:

Run-time Error '-2147417848 (80010108)':
Method 'Hidden' of object 'Range' failure

When I run debug, I get the following line highlighted:
Rows("31:65536").Hidden = False

I tried this by using Record Macro too, but I get the same error message
when I try to run the macro. What am I missing here?

"Bob Phillips" wrote:

You should be specifying which rows are to be hidden, such as

Rows("3:7").Hidden = False


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Montana" wrote in message
...
I am running the following macro:

Sub open1()

ActiveSheet.Unprotect Password:="password"
ActiveWindow.DisplayHeadings = True
Columns.Hidden = False
Rows.Hidden = False
ActiveWorkbook.Unprotect Password:="password"
Sheets("sheet1").Visible = True
Sheets("sheet2").Visible = True
Sheets("sheet3").Select
Range("P3").Select

The problem that I am having is when the macro gets to "Rows.Hidden =
False," it corrupts the data in column L in sheet3 & I don't have a clue
as
to why. Help!

Thanks in advance, Montana




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Enabling option „Format rows“ to hide/unhide rows using VBA-code? ran58 Excel Discussion (Misc queries) 0 July 28th 09 03:46 PM
unhide row does not unhide the hidden rows nikita Excel Worksheet Functions 4 May 24th 08 02:59 PM
Hide Rows (Current Date) / Unhide Rows Joe K. Excel Programming 1 October 10th 07 05:37 PM
Unhide rows [email protected] Excel Discussion (Misc queries) 3 December 14th 04 05:28 PM
Can't Unhide Rows sclark Excel Programming 2 January 18th 04 01:11 AM


All times are GMT +1. The time now is 10:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"