Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Hiding a Worksheet

Hi,

Am trying to hide a worksheet through VBA code. The line of code below
ought to do that:

worksheets(1).visible = xlveryhidden

But it doesn't work!!

Anyone with ideas??

--
Many thanks in advance for any assistance
Marek
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Hiding a Worksheet

Demo'd from the immediate window
? xlSheetVeryHidden
2
? xlVeryHidden
2

shouldn't make any difference. Use 2 instead of the constant if you wish.

--
Regards,
Tom Ogilvy


"Vergel Adriano" wrote:

Try it this way:

worksheets(1).visible = xlSheetVeryHidden


--
Hope that helps.

Vergel Adriano


"Marek" wrote:

Hi,

Am trying to hide a worksheet through VBA code. The line of code below
ought to do that:

worksheets(1).visible = xlveryhidden

But it doesn't work!!

Anyone with ideas??

--
Many thanks in advance for any assistance
Marek

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Hiding a Worksheet

Hi Marek

It is

xlSheetVeryHidden



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Marek" wrote in message ...
Hi,

Am trying to hide a worksheet through VBA code. The line of code below
ought to do that:

worksheets(1).visible = xlveryhidden

But it doesn't work!!

Anyone with ideas??

--
Many thanks in advance for any assistance
Marek

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Hiding a Worksheet

Hi Marek

You can try this one

Sub test()
Dim rng As Range
Dim j As Integer

For j = 1 To Sheets.Count
Set rng = Nothing
On Error Resume Next
Set rng = Sheets(j).UsedRange.SpecialCells(xlCellTypeFormula s, 23)
On Error GoTo 0
If Not rng Is Nothing Then
With rng.Interior
.ColorIndex = 36
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
End If
Next j
End Sub


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Marek" wrote in message ...
Hi,

Am trying to hide a worksheet through VBA code. The line of code below
ought to do that:

worksheets(1).visible = xlveryhidden

But it doesn't work!!

Anyone with ideas??

--
Many thanks in advance for any assistance
Marek

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Hiding a Worksheet

Oops, wrong thread

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Ron de Bruin" wrote in message ...
Hi Marek

You can try this one

Sub test()
Dim rng As Range
Dim j As Integer

For j = 1 To Sheets.Count
Set rng = Nothing
On Error Resume Next
Set rng = Sheets(j).UsedRange.SpecialCells(xlCellTypeFormula s, 23)
On Error GoTo 0
If Not rng Is Nothing Then
With rng.Interior
.ColorIndex = 36
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
End If
Next j
End Sub


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Marek" wrote in message ...
Hi,

Am trying to hide a worksheet through VBA code. The line of code below
ought to do that:

worksheets(1).visible = xlveryhidden

But it doesn't work!!

Anyone with ideas??

--
Many thanks in advance for any assistance
Marek



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Hiding a Worksheet

Come on Ron, don't turn into a newbie:

Demo'd from the immediate window
? xlSheetVeryHidden
2
? xlVeryHidden
2

shouldn't make any difference. Use 2 instead of the constant if you wish.

--
Regards,
Tom Ogilvy


"Ron de Bruin" wrote:

Hi Marek

It is

xlSheetVeryHidden



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Marek" wrote in message ...
Hi,

Am trying to hide a worksheet through VBA code. The line of code below
ought to do that:

worksheets(1).visible = xlveryhidden

But it doesn't work!!

Anyone with ideas??

--
Many thanks in advance for any assistance
Marek


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Hiding a Worksheet

You are correct Tom, both work.
I never use xlVeryHidden

Btw: I believe I not see all replies in a few threads today in Windows Mail
Also Google show threads with only my reply ???

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Tom Ogilvy" wrote in message ...
Come on Ron, don't turn into a newbie:

Demo'd from the immediate window
? xlSheetVeryHidden
2
? xlVeryHidden
2

shouldn't make any difference. Use 2 instead of the constant if you wish.

--
Regards,
Tom Ogilvy


"Ron de Bruin" wrote:

Hi Marek

It is

xlSheetVeryHidden



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Marek" wrote in message ...
Hi,

Am trying to hide a worksheet through VBA code. The line of code below
ought to do that:

worksheets(1).visible = xlveryhidden

But it doesn't work!!

Anyone with ideas??

--
Many thanks in advance for any assistance
Marek


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 the worksheet Narnimar Excel Discussion (Misc queries) 8 July 12th 07 05:30 AM
Hiding a Worksheet oceanmist Excel Discussion (Misc queries) 3 June 14th 07 04:48 PM
Hiding a Worksheet Tom Ogilvy Excel Programming 0 March 28th 07 12:01 AM
Hiding a Worksheet Vergel Adriano Excel Programming 0 March 27th 07 11:46 PM
Hiding a Worksheet Tom Ogilvy Excel Programming 0 March 27th 07 11:21 PM


All times are GMT +1. The time now is 10:56 PM.

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"