Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AutoFilter

Status
Not open for further replies.

white605

Technical User
Jan 20, 2003
394
US
Hello,
I worked thru the previous thread and came up with
Code:
Sub copythis()

Selection.AutoFilter Field:=1, Criteria1:="<>,", Operator:=xlAnd
Sheets("sheet1").[A1].CurrentRegion.SpecialCells(xlCellTypeVisible).Copy _
  Destination:=Sheets("sheet2").[A1]
End Sub
When I watched the code work, it struck me that Autofilter is working like a sql statement:
select * from rows where ????
with the result becoming visible.
Is this what is going on behind the scenes or is it just similar behavior?

This old world keeps spinning round - It's a wonder tall trees ain't layin' down
 




Hi,

A query returns a resultset that is separate from the source data, which can be multiple tables.

A filter returns data in place.

Did you manage to combine this procedure with the Copy & Paste that you were looking for?

Skip,
[glasses]Don't let the Diatribe...
talk you to death![tongue]

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
jnameika started the original post.

I was watching the post and working thru the code.
The code works.

Mabee i put it wrong. What i was noticing was that after applying the autofilter, the sheet "looked like" the result i would have gotten if i had selected it from a table or dbf or whatever with sql, and with the selection/copy and paste to another sheet the result was the same, so to speak.
wjwjr

This old world keeps spinning round - It's a wonder tall trees ain't layin' down
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top