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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

filter excelfile, copy-> paste using VBA

Status
Not open for further replies.

kingz2000

Programmer
May 28, 2002
304
DE
Hi,

I'm programming VBA behind Excel. I have an excelsheet with Data, which I would like to filter and have only the resulting data copied over to another worksheet. My Code currently reads as following:

Private Sub split_schleckerland()

With Worksheets("Stammdaten")
[Y3].AutoFilter Field:=25, Criteria1:="X"
[Z3].AutoFilter Field:=26, Criteria1:="X"
[AA3].AutoFilter Field:=27, Criteria1:="X"
[AB3].AutoFilter Field:=28, Criteria1:="X"
[AC3].AutoFilter Field:=29, Criteria1:="X"
[AD3].AutoFilter Field:=30, Criteria1:="X"
Cells.SpecialCells(xlCellTypeVisible).Copy Destination:=Sheets("Schleckerland").[A1]
End With
End Sub

unfortunately, the resulting Data which is pasted is merely the whole data filtered. I want ONLY the filtered data without any filer settings as a resulting data. How do I accomplish this?
 


Hi,

Copy and PasteSpecial - Values

Turn on your macro recorder.

Skip,

[glasses] [red]Be Advised![/red] Coeds studying ancient Egyptian plumbing, might be known as...
Pharaoh Faucet Majors [tongue]
 
Are you sure of the value you put in the Field named argument ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 

Copy and PasteSpecial - Values?? How do I do that???
1or 2 Code lines,please?
 
sorry I have never used makros....how do I turn on the makro reader??
 


Tools/Macro/Record new macro...

Skip,

[glasses] [red]Be Advised![/red] Coeds studying ancient Egyptian plumbing, might be known as...
Pharaoh Faucet Majors [tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top