simple conditional find, copy and paste

L

lothario

Hi,

I have:

Workbook called "wb1".
=> It contains sheets "Asheet" and "Bsheet".
=> "Asheet" contains 900 rows of data.
=> "Asheet" contains the columns "1col", "2col", "3col", "4col"
"5col", etc ...

I would like to:

* Have a button in "Bsheet" called "Get Data from Asheet".
* First the user enters some search criteria text in cell c5 i
"Bsheet".
* Then he clicks on the "Get Data from Asheet" button.
* The VBA code attached to the "Get Data from Asheet" button woul
then find all the rows in "Asheet" where "3col" contains the text tha
is specified in cell c5 in "Bsheet".
* All the rows in "Asheet" that contain this text in "3col" should b
copied to "Bsheet" beginning at cell d9.
* Note: in the case of column "3col" the text should just contain th
criteria text. There is no need for an exact match or cas
sensitivity.

Can you please give me the VBA code for this "Get Data from Asheet
button?

Thanks,
Luthe
 
L

lothario

Hi,

I still need help with this VBA script.
Can you please help?

Thanks,
Luther
 
B

Bill Manville

Lothario said:
I still need help with this VBA script.
Can you please help?
Something like this - but you may need to adjust the bit about the
criteria - not sure if I have understood your requirement


With ASheet.Range("A1").CurrentRegion
.AutoFilter
.AutoFilter 3, BSheet.Range("C5").Value
.Offset(1).SpecialCells(xlVisible).Copy
BSheet.Range("D9").PasteSpecial xlValues
Application.CutCopyMode = False
.AutoFilter
End With

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup
 

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