Macro that "shows all data " in several sheets.

S

Snoopy

Hey guys
I want my macro to check some of the sheets in a workbook (e.g. l
sheets with sheetname beginning with "Rev") and un-filter the ones
that has set a filter (using macro-statement: ShowAllData?).
My workbook occasionally expands with new "Rev"'s.

The next step in my macro (and this works actually :) ) will copy
every "Rev"sheet content and paste this into a "master"-sheet for
further processing, but so far I just copy filtered data when filter
is activated in the "Rev" and this causes me trouble.

My effort to make a loop like this has been no success and I consult
the world wide for som guiding here.

I will appreciate your helping hand :)

Regards
Snoopy
 
D

Dave Peterson

dim wks as worksheet
for each wks in activeworkbook.worksheets
with wks
if lcase(.name) like lcase("rev*") then
'show all the data
If .FilterMode Then
.ShowAllData
End If
end if
end with
next wks

(untested, uncompiled. Watch out for typos!)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top