View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_7_] Bob Phillips[_7_] is offline
external usenet poster
 
Posts: 1,120
Default Can't hide/unhide rows under worksheet change event?

I just knocked up a quick test and it worked fine for me. What code do you
have in HideRateRows?

--
HTH

Bob Phillips

"Don Wiss" wrote in message
...
I am using xl 2002. I have this macro behind the worksheet that I wish to
use to unhide/hide some rows:

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = Range("AdjBasis").Address Then
HideRateRows
End If

End Sub

The AdjBasis range is a Data Validation drop down list. The above macro is
successfully calling the HideRateRows macro. Inside that macro I am trying
to unhide or hide some rows on the same sheet the change event and Data
Validation are on. I can step through the code and the lines are being

run.
But the rows will not switch states between being hidden or not. I have
stopped the macro and in immediate mode issued the code to hide or unhide.
The rows still do not change their state. I have spent a bit of time on
this and have no idea why it doesn't work.

If the HideRateRows macro is run not under a change event then it works
fine.

Don <www.donwiss.com (e-mail link at home page bottom).