Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem Hiding Columns

137 views
Skip to first unread message

Kent

unread,
Jun 30, 2002, 8:40:49 AM6/30/02
to
I am having problems when I try to hide columns. I get an error that says
objects cannot be shifted off the sheet. Sometimes I get a message telling
me to delete the areas to the right and below the data area, select cell A1
and save the spreadsheet to reset the used range. That does not help. I am
using about 200 columns and programmatically hide and unhide columns. I also
insert columns, but never use more that 200? Any help will be greatly
appreciated. I've fought this one for 2 days now.


Debra Dalgleish

unread,
Jun 30, 2002, 8:51:16 AM6/30/02
to
The following MSKB article may help:

XL97: "Cannot Shift Objects Off Sheet" Error Hiding Columns (Q170081)
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q170081


--

Debra Dalgleish

Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

William

unread,
Jun 30, 2002, 3:08:32 PM6/30/02
to
Hi Kent
XL2002

I came across this problem recently. I had a button from the Forms toolbar
in cell J1.

The code below works if the properties attached to that button are "Move and
Size with cells" but fails if the property is either "Don't move or size
with cells" or "Move but don't size with cells".

Sub HideCols()
Columns("J:IV").EntireColumn.Hidden = True
End Sub

So, if you have a button on your worksheet, right click on the button,
select "Format Control", select "Properties" and then select "Move and Size
with cells"

The above is very similar to the solution Debra's reference relates to, but
that article refers to "Comments". It appears to also apply to "buttons" and
possibly other objects but I have not tested these.

--

Regards

William
willw...@yahoo.com

"Kent" <kent....@swri.org> wrote in message
news:uhtv362...@corp.supernews.com...

0 new messages