Certain info from one workbook to another

I

ihatetheredskins

I have a Workbook A. I want to take certain rows and display them in order
in Workbook B.

The rows have 25 columns. If I take all rows that have 302 in Column B how
can I display those row contents in an entirely different workbook just
containing 302 info?
 
G

Gord Dibben

Data>Filter>Autofilter for 302 on Column B

Copy and paste the visible results to the other workbook.


Gord Dibben MS Excel MVP
 
I

ihatetheredskins

Gord Dibben said:
Data>Filter>Autofilter for 302 on Column B

Copy and paste the visible results to the other workbook.


Gord Dibben MS Excel MVP



Yes, I can do this. But is there a way that it can be automated with a formula instead of manually doing this?
 
G

Gord Dibben

Turn on the macro recorder and record yourself filtering, copying visible cells
and pasting to another workbook.

You will get something like this.

Sub Macro3()
'
' Macro3 Macro
' Macro recorded 04-19-2007 by Gord Dibben
'

'
Columns("A:F").Select
Selection.AutoFilter
Selection.AutoFilter Field:=3, Criteria1:="1Night"
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Workbooks.Open Filename:= _
"C:\program files\microsoft office\exceldata\copyfilter.xls"
ActiveSheet.Paste
Application.CutCopyMode = False
Range("A1").Select
End Sub


Gord
 
Top