Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The following code works fine in Excel 2000, but will not
work in XP. I'm getting an "object required" error on line 3; "If Target.Address = "$E$1" Then". Thanks for any help on this. Sub Worksheet_Change(ByVal Target As Excel.Range) Dim ws As Worksheet If Target.Address = "$E$1" Then If Target.Value _ = "Hi-Low" Then For Each ws In Sheets(Array("Period 1", "Period 2", "Period 3", "Period 4", "Period 5", "Period 6", _ "Period 7", "Period 8", "Period 9", "Period 10", "Period 11", "Period 12")) ws.Columns("M:O").EntireColumn.Hidden = False Next ws End If If Target.Value _ = "EDLC" Then For Each ws In Sheets(Array("Period 1", "Period 2", "Period 3", "Period 4", "Period 5", "Period 6", _ "Period 7", "Period 8", "Period 9", "Period 10", "Period 11", "Period 12")) ws.Columns("M:O").EntireColumn.Hidden = True Next ws End If End If End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Your code worked fine for me (xl2002).
Eva Shanley wrote: The following code works fine in Excel 2000, but will not work in XP. I'm getting an "object required" error on line 3; "If Target.Address = "$E$1" Then". Thanks for any help on this. Sub Worksheet_Change(ByVal Target As Excel.Range) Dim ws As Worksheet If Target.Address = "$E$1" Then If Target.Value _ = "Hi-Low" Then For Each ws In Sheets(Array("Period 1", "Period 2", "Period 3", "Period 4", "Period 5", "Period 6", _ "Period 7", "Period 8", "Period 9", "Period 10", "Period 11", "Period 12")) ws.Columns("M:O").EntireColumn.Hidden = False Next ws End If If Target.Value _ = "EDLC" Then For Each ws In Sheets(Array("Period 1", "Period 2", "Period 3", "Period 4", "Period 5", "Period 6", _ "Period 7", "Period 8", "Period 9", "Period 10", "Period 11", "Period 12")) ws.Columns("M:O").EntireColumn.Hidden = True Next ws End If End If End Sub -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Worksheet change Event | Excel Worksheet Functions | |||
Worksheet Change Event | Excel Discussion (Misc queries) | |||
Worksheet change event | Excel Programming | |||
help with worksheet change event | Excel Programming | |||
Worksheet Change Event Help Please | Excel Programming |