LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Hide sheet via codename

Hi,

Is there a method for hiding a sheet via the codename, when the
codename is not hard coded but derived from cells in a spreadsheet?

Eg. I would like to loop through cells which contain codenames. If
the codename is ticked, then I want to run a sub to hide that sheet,
using that codename. By way of illustration:

Set rng = Sheets("Lookups").Range("A1:A20")
For Each cell In rng
Set x = ThisWorkbook.VBProject.VBComponents(cell)
x.Visible = xlSheetHidden
Next cell

I'm not sure why this throws up error 438 at the line:
x.visible = xlSheetHidden

I've tried various permuations but can't get it to work. Many thanks in
advance if anyone kindly provides a solution.

Regards,
Chris Adams

 
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
Use of sheet codename in codeline - How? Jim May Excel Programming 3 July 1st 06 04:24 PM
change sheet codename Gary Keramidas Excel Programming 4 March 5th 06 12:54 AM
Selecting a sheet by codename Dr.Schwartz Excel Programming 3 September 3rd 04 02:15 PM
Using sheet codename problems Dustin Carter Excel Programming 1 February 20th 04 10:26 PM


All times are GMT +1. The time now is 03:01 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"