View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
KBarrett KBarrett is offline
external usenet poster
 
Posts: 3
Default Excel 2007 VBA - macro stops after autofilter command

KBarrett wrote:
I have a spreadsheet that was created in an earlier version of Excel
and is now being used in Excel 2007 with compatibility mode on. *One
of the macros filters the data on the sheet, using the autofilter
command, based on selections the user has made via a pop-up form.
Previous to Excel 2007, this was working fine. *Now it appears the any
command lines following the autofilter command are ignored. *Has
anyone encountered a similar situation?


I think I may have stumbled upon the cause of the problem. The
worksheet has a LOT of conditional formatting that has gotten messy
over the years but had never caused a problem in previous versions of
Excel (one of the things on my 'to-do' list was to clean it all up in
the 2007 version). When I removed all of the conditional formatting
from the sheet, my code ran fine and continued on past the autofilter
commands. I'm guessing the code was hanging on trying to evalute the
conditional formatting after the autofilter? I had put a timer in
the code before and after the one autofilter line, but lost patience
after waiting 15 minutes (there are only 4500 lines of data on the
sheet). As I sais, this wasn't a problem in Excel 2003. Now I have
to go back and add a cleaned-up version of the conditional formatting
and hope it doesn't hang on the autofilters again. Ahhhh,
Progress!! :-)

Thanks for the responses that helped get me thinking "outside the
box"
on ths one!


Karen