Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Maco code doesn't work. Why?
I am using Excel 2003. I have inserted the following code into a macro to
hide any sheets where cell N1="x". This is the only code in the macro. When I run I get an error (below). Dim wks as worksheet for each wks in activesheet.worksheets if lcase(wks.range("n1").value) = lcase("x") then wks.visible = xlsheethidden end if next wks ERROR: Object doesn't support this property or method (Error 438) Can someone help? Thanks, Joe M. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Maco code doesn't work. Why?
Hi,
Try this Dim wks As Worksheet For Each wks In ActiveWorkbook.Worksheets If LCase(wks.Range("n1").Value) = "x" Then wks.Visible = xlSheetHidden End If Next wks Mike "Joe M." wrote: I am using Excel 2003. I have inserted the following code into a macro to hide any sheets where cell N1="x". This is the only code in the macro. When I run I get an error (below). Dim wks as worksheet for each wks in activesheet.worksheets if lcase(wks.range("n1").value) = lcase("x") then wks.visible = xlsheethidden end if next wks ERROR: Object doesn't support this property or method (Error 438) Can someone help? Thanks, Joe M. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Maco code doesn't work. Why?
Sorry about the typo!
Joe M. wrote: I am using Excel 2003. I have inserted the following code into a macro to hide any sheets where cell N1="x". This is the only code in the macro. When I run I get an error (below). Dim wks as worksheet for each wks in activesheet.worksheets if lcase(wks.range("n1").value) = lcase("x") then wks.visible = xlsheethidden end if next wks ERROR: Object doesn't support this property or method (Error 438) Can someone help? Thanks, Joe M. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Protect a maco in master copy | Excel Discussion (Misc queries) | |||
macro security warning when no maco in workbook | Excel Discussion (Misc queries) | |||
Is there any way to have a maco click a command button | Excel Discussion (Misc queries) | |||
Auto run maco/change behavior of save/close | Excel Discussion (Misc queries) | |||
A simple maco . . . | New Users to Excel |