View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
davegb davegb is offline
external usenet poster
 
Posts: 573
Default Looking for Rod over in the corner...

I guess this is called learning by experience. I actually thought about
whether or not I should name the range and the macro the same, and
decided to do so would be a plus from a programming POV because then it
would be easy to follow that the range "FilterRange" was created by the
macro FilterRange. I thought that the range would always be in quotes,
the macro name would never be, so there wouldn't be a problem. I was
astonished when the macro wouldn't run, and to test the range name
validity, I did a Edit GoTo and it went to the macro! So I hear what
you're saying.
What I still don't understand is why the problem didn't surface sooner.
I created the range and the macro over a week ago. Since then, I've
been adding additional sheets to the workbook. An Auto_Open macro
creates a named range "FilterRange" in each sheet when the workbook is
opened. When I go to an individual sheet, the different filters for
that particular sheet use "FilterRange". Some filters are common to all
sheets, others unique to a particular sheet. But they've been working
very consistently.
Tuesday I changed them all so that the filters and conditional
formatting all use common cells on each sheet for the input, so that if
the regulations change, all I have to do is edit one cell, and
everything else changes automatically. That's the last thing I did
before I left, and I tested to make sure they worked. But I didn't have
time to close the worksheet, reopen it, and test. That happened the
next morning, and the macros failed.
Can you, Jim, or anyone suggest why they failed at that point, rather
than way back when I first created them with the same name?