Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / May 2008

Tip: Looking for answers? Try searching our database.

columns

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
geebee - 27 May 2008 16:33 GMT
hi,

i want to be able to hide and unhide columns in excel depending upon a value
selected and then veryfying whether or not a value entered is correct.  but
the only disadvantage of this is that any user who does not enter the value
correctly can just go to the sheet and select column --> unhide.  i want to
prevent this from happening.

what is the best way to handle this?

thanks in advance,
geebee
Jim Thomlinson - 27 May 2008 16:46 GMT
One way might be to remove the row and column headers. Tools -> Options ->
View -> uncheck Row & Column Headers.

This will make it distinctly more difficult to unhide the columns without
having to resort to some form of protection.
Signature

HTH...

Jim Thomlinson

> hi,
>
[quoted text clipped - 8 lines]
> thanks in advance,
> geebee
geebee - 27 May 2008 19:08 GMT
hi,

i have the following:

If Sheets("detail").Range("IV1").Value = "admin" Then
Sheets("detail").Select
Columns("A").Visible = True
Else
Sheets("detail").Select
Columns("G").Visible = False
End If

but i am getting an "object does not support this method" error message.  why?

thanks in advance,
geebee

> One way might be to remove the row and column headers. Tools -> Options ->
> View -> uncheck Row & Column Headers.
[quoted text clipped - 14 lines]
> > thanks in advance,
> > geebee
atpgroups - 27 May 2008 16:55 GMT
>  i want to
> prevent this from happening.
> what is the best way to handle this?

This may not be the _best_ way, but will work. Just turn off the menu
items.

Application.CommandBars("Worksheet Menu
Bar").Controls("Format").Controls("&Column").Controls("&Unhide").Enabled
= False
Application.CommandBars("Column").Controls("&Unhide").Enabled = False

You might need to re-do the Column menu on the workbook_RightClick
event.
geebee - 27 May 2008 20:05 GMT
hi,

i am getting an "invalid procedure call or argument".  on the following:

Application.CommandBars("Worksheet
MenuBar").Controls("Format").Controls("&Column").Controls("&Unhide").Enabled
= True

thanks in advance,
geebee

> >  i want to
> > prevent this from happening.
[quoted text clipped - 10 lines]
> You might need to re-do the Column menu on the workbook_RightClick
> event.
atpgroups - 28 May 2008 20:13 GMT
> i am getting an "invalid procedure call or argument".  on the following:
>
> Application.CommandBars("Worksheet
> MenuBar").Controls("Format").Controls("&Column").Controls("&Unhide").Enable d
> = True

Is that space in the middle of"Enabled" really there? That will do
it.
Alternatively, find your own way to the menu item..
Select the words "Application.CommandBars" and then right-click and
"Add watch"
You will then see the tree of all the command bar properties, and you
can burrow on down the tree. I suspect that (for whatever reason) your
commandbars have different names
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.