Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 41
Default Hiding Columns produces error <----HELP PLEASE

Hello -

Below is a snipit of code I have for hding columns. I am getting the
Runtime Error "Unable to set the Hidden Property of the Range Class".
I'm using Excel 2007 and wonder if there is a limit to the amount of
columns I can hide in VBA.

Else
Columns("S:AW").Hidden = True
Columns("AX:AX").Hidden = False
Columns("AY:ZZ").Hidden = True
Columns("AAA:WWW").Hidden = True
Columns("WWX:XAA").Hidden = True
Columns("XAB:XDD").Hidden = True
Columns("XDE:XFD").Hidden = True

I basically want to hide columns AY:XFD, but can't seem to make it
work in one line of code. I appreciate any advice.

Thanks!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Hiding Columns produces error <----HELP PLEASE

Dan presented the following explanation :
Hello -

Below is a snipit of code I have for hding columns. I am getting the
Runtime Error "Unable to set the Hidden Property of the Range Class".
I'm using Excel 2007 and wonder if there is a limit to the amount of
columns I can hide in VBA.

Else
Columns("S:AW").Hidden = True
Columns("AX:AX").Hidden = False
Columns("AY:ZZ").Hidden = True
Columns("AAA:WWW").Hidden = True
Columns("WWX:XAA").Hidden = True
Columns("XAB:XDD").Hidden = True
Columns("XDE:XFD").Hidden = True

I basically want to hide columns AY:XFD, but can't seem to make it
work in one line of code. I appreciate any advice.

Thanks!


Try...

Columns("S:XFD") = True: Columns("AX").Hidden = False

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


  #3   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 41
Default Hiding Columns produces error <----HELP PLEASE

Thanks Garry, will give this a try.
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
hiding columns, error message says cannot shift objects off sheet JORGE ORTIZ Excel Discussion (Misc queries) 11 August 19th 08 10:34 AM
Why do I get an error message hiding excel columns George Excel Worksheet Functions 2 October 30th 07 09:01 AM
Refresh produces #N?A error RhysPieces Excel Discussion (Misc queries) 1 July 10th 07 09:16 AM
hiding columns in Excell error message jude Excel Discussion (Misc queries) 2 October 12th 06 07:32 PM
CreateObject produces error Robert Chapman Excel Programming 0 August 15th 03 03:48 PM


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

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"