![]() |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
All times are GMT +1. The time now is 02:11 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com