Doug,
Open a new workbook. Save it.
In A1, Enter the Value Doug
close the workbook without saving
Open it up.
Is the word Doug in A1.
It isn't.
Same principle for Filtering. I don't know what you are observing, but if
you don't save the workbook, any changes made, include filter settings, will
not be saved.
Let me know what basic concepts about saving files you don't understand.
I believe you understood what Golf wanted - your solution would work if the
user elects to save the workbook when prompted - however, the root of the
problem is that the users are not behaving as is, so the approach, as
offered, would be self defeating from the start.
--
Regards,
Tom Ogilvy
"Doug Glancy" wrote in message
...
Tom,
On my machine with xl2000, win xp, I don't need to save before closing for
it to work. As soon as I close the book, it turns off autofiltering,
turns
it back on, and then asks whether to save. Even if not saved, when opened
back up filtering is on but no filters are set, which I think is what Golf
wanted.
Also, I inlcuded the before save because Golf asked for the filter to be
reset upon saving or closing.
Let me know if I'm not understanding you.
Thanks,
Doug
"Tom Ogilvy" wrote in message
...
Doug,
Any change you make must be saved to be "in effect" when the workbook is
opened. It seems you should put a save command in the beforeclose after
you
make your settings. Then you would not need to duplicate the code in
the
before save.
--
Regards,
Tom Ogilvy
"Doug Glancy" wrote in message
...
Golf,
It seems to me the easiest thing is to write code that turns filtering
off
and on before closing or saving. To do so, I'd paste this code into
the
ThisWorkBook module in the VBE:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Worksheets("Sheet1").UsedRange.AutoFilter
Worksheets("Sheet1").UsedRange.AutoFilter
End Sub
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Worksheets("Sheet1").UsedRange.AutoFilter
Worksheets("Sheet1").UsedRange.AutoFilter
End Sub
hth,
Doug
"golf4" wrote in message
om...
Hi, everyone -
I have a quick question regarding a detailed spreadsheet that I have
created. My spreadsheet track vacancy days for a local housing
agency.
Data entry field include aspects like Vacate Date, Re-Rent Date,
Work
Order Created Date, Specific Program, Caseworker Name, etc.
Right now, I have turned on the Auto-Filter on all of the columns so
that we can filter out vacated units by program, by caseworker, etc.
The problem that we're having is that, once an employee does some
filtering and saves the spreadsheet, the next time it's opened the
filter is still filtering the same data. Employees that are not,
necessarily familiar with Excel, can't really tell all of the units
that are included on the spreadsheet unless they "unfilter" the
column(s).
I was wondering whether someone could help with some VB code that,
upon saving or closing the spreadsheet, the filtering will be
removed
from all of the columns but won't turn off the Auto-Filter? If it
will
help, I would, certainly, be willing to forward my spreadsheet if it
will provide clarification on what I'm talking about.
Thanks, again, for all the help.
Golf