Hiding a Worksheet

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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??
 
Demo'd from the immediate window
? xlSheetVeryHidden
2
? xlVeryHidden
2

shouldn't make any difference. Use 2 instead of the constant if you wish.
 
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(xlCellTypeFormulas, 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
 
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 said:
Hi Marek

It is

xlSheetVeryHidden
 
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 said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top