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

creating a Macro

Status
Not open for further replies.

Newatprogramming

Technical User
Mar 5, 2002
30
US
I am trying to create a macro that could from a list of numbers in a column, be able to find all matching numbers in the first column from another worksheet, extract the row into another worksheet. For example:

( WORKSHEET 1 )
( find these numbers in the first column of worksheet 2, and copy the whole row to worksheet 3.

2222
2333
2323
2313


(WORKSHEET 2)

2221 12/23
2222 12/22
2223 12/22

2322 12/22
2323 12/22
2324 12/22


(WORKSHEET 3)

2222 12/22
2323 12/22
 
Hi New,

Your situation appears to be a "perfect" one for use of Excel's "database extraction" function.

This is found under the menu: Data - Filter - Advanced Filter. However, most Excel users don't end up using this POWERFUL feature - because of a couple of BUGS. For example one BUG will inform the user it's NOT possible to extract data to a SEPARATE sheet. This IS possible - through the use of VBA.

An added "bonus" is that this method is EXTREMELY FAST - because this built-in "custom" function is based on the C-language which is MUCH faster than using VBA.

I could email you an example file, but it will likely be MUCH easier for you if you were to email me your file (or a scaled down version if you like - and with sensitive data replaced with fictitious data if that's a concern).

I'll then modify the file and return it.

I hope this can help.

Regards, ...Dale Watson dwatson@bsi.gov.mb.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top