copy paste

E

Eric

Helo all,

On sheets("Test Database") I have 2,000 tests spanning from column A to AD.
these tests are of different mix types. In Column B is the mix type.

On sheets("main menu") in cell ("B9") I have a mix number 4064 which is
choosen from a drop down box consisting of 28 different number (4052-4079).

What I need to do is when sheets("main menu") range("B9") has a number I
need the last 4 tests from sheets("Tests Database") that match sheets("main
menu") range("B9") to copy all the rows (A-AD) over to another sheet called
sheet("Last 4").

ie:
sheets("main menu").Range("B9")=4064

sheets("test database") looks like this:
A B C D.......
4064
4064~~~> This row would post on to sheets("Last 4")
4052
4052
4064~~~> This row would post on to sheets("Last 4")
4052
4064~~~> This row would post on to sheets("Last 4")
4064~~~> This row would post on to sheets("last 4")

Column "A" is the date the test was run......

Does this make any sense? Any help would be appreciated.......Eric
 
J

Joel

Sheets("Tests Database").Columns("B:B").AutoFilter
Sheets("Tests Database").Columns("B:B").AutoFilter Field:=1, _
Criteria1:=Sheets("main menu").Range("B9")

Sheets("Tests Database").Rows.SpecialCells(xlCellTypeVisible).Copy
Sheets("Last 4").Rows(1).PasteSpecial
 
E

Eric

Hey Joel,

It's not working. It is copying all the tests with the to cell("B9") not
just the last 4.
also, maybe I should have told you this before (I didn't think it made a
difference, sorry). I am starting the copy from row 27 on sheets("test
database") and starting the paste from row 9 on sheets("Last 4").

Can we do anything different? Eric
 

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