Macro that "shows all data " in several sheets.

  • Thread starter Thread starter Snoopy
  • Start date Start date
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
 
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!)
 
Back
Top