Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Unable to set Hidden Property


I have the following code. It is failing on the hilited line. I am
getting a Run-time error '1004', Unable to set Hidden property of the
Range class. I checked and the range name does exist. The HideMonths
and HideYr5 variables are both equal to True. If I comment out the
line, everything finishes processing ok.

Sheets("Other_Input").Select
Range("OthMonthlyYr1").EntireColumn.Hidden = HideMonths
Range("OthMonthlyYr2").EntireColumn.Hidden = HideMonths Or
HideYr2
Range("OthMonthlyYr3").EntireColumn.Hidden = HideMonths Or
HideYr3
Range("OthMonthlyYr4").EntireColumn.Hidden = HideMonths Or
HideYr4
Range("OthMonthlyYr5").EntireColumn.Hidden = HideMonths Or
HideYr5


I even tried
Worksheets("Other_Input").Range("OthMonthlyYr5").E ntireColumn.Hidden =
HideMonths Or HideYr5, but that didn't work either.

Can anyone help me?


--
LAF
------------------------------------------------------------------------
LAF's Profile: http://www.excelforum.com/member.php...fo&userid=9656
View this thread: http://www.excelforum.com/showthread...hreadid=398466

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Unable to set Hidden Property

merged cells?

Tim


"LAF" wrote in
message ...

I have the following code. It is failing on the hilited line. I am
getting a Run-time error '1004', Unable to set Hidden property of
the
Range class. I checked and the range name does exist. The
HideMonths
and HideYr5 variables are both equal to True. If I comment out the
line, everything finishes processing ok.

Sheets("Other_Input").Select
Range("OthMonthlyYr1").EntireColumn.Hidden = HideMonths
Range("OthMonthlyYr2").EntireColumn.Hidden = HideMonths Or
HideYr2
Range("OthMonthlyYr3").EntireColumn.Hidden = HideMonths Or
HideYr3
Range("OthMonthlyYr4").EntireColumn.Hidden = HideMonths Or
HideYr4
Range("OthMonthlyYr5").EntireColumn.Hidden = HideMonths Or
HideYr5


I even tried
Worksheets("Other_Input").Range("OthMonthlyYr5").E ntireColumn.Hidden
=
HideMonths Or HideYr5, but that didn't work either.

Can anyone help me?


--
LAF
------------------------------------------------------------------------
LAF's Profile:
http://www.excelforum.com/member.php...fo&userid=9656
View this thread:
http://www.excelforum.com/showthread...hreadid=398466



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 253
Default Unable to set Hidden Property

Hi,
I had that problem if some cells contained comments.
Regards,
Jean-Yves


"LAF" wrote in message
...

I have the following code. It is failing on the hilited line. I am
getting a Run-time error '1004', Unable to set Hidden property of the
Range class. I checked and the range name does exist. The HideMonths
and HideYr5 variables are both equal to True. If I comment out the
line, everything finishes processing ok.

Sheets("Other_Input").Select
Range("OthMonthlyYr1").EntireColumn.Hidden = HideMonths
Range("OthMonthlyYr2").EntireColumn.Hidden = HideMonths Or
HideYr2
Range("OthMonthlyYr3").EntireColumn.Hidden = HideMonths Or
HideYr3
Range("OthMonthlyYr4").EntireColumn.Hidden = HideMonths Or
HideYr4
Range("OthMonthlyYr5").EntireColumn.Hidden = HideMonths Or
HideYr5


I even tried
Worksheets("Other_Input").Range("OthMonthlyYr5").E ntireColumn.Hidden =
HideMonths Or HideYr5, but that didn't work either.

Can anyone help me?


--
LAF
------------------------------------------------------------------------
LAF's Profile:

http://www.excelforum.com/member.php...fo&userid=9656
View this thread: http://www.excelforum.com/showthread...hreadid=398466



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
Unable to Set the XValues Property of the Series KathyC Charts and Charting in Excel 5 January 4th 07 09:26 PM
Unable to set the XValues Property Ali Baba Charts and Charting in Excel 2 September 14th 05 04:54 AM
unable to set hidden property davegb Excel Programming 2 March 22nd 05 12:03 AM
Run Time Error 1004 Unable to set hidden property Lester Lee Excel Programming 3 July 22nd 04 03:31 AM
Unable to get VLOOKUP property cici Excel Programming 1 February 10th 04 11:24 PM


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

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

About Us

"It's about Microsoft Excel"