I need somebody guide me with the search function using textbox at userform with multi criteria.
From the attached, the Book01.xls will be the workbook which will be search to find through the Userform which i created inside the workbook. The search function userform consist of 2 Textbox:
Textbox1 for Date search
Textbox2 for Brand search
and a CommandButton1 named Search.
The search method:
Click the Search button at the first userform and the search function userform will show.
Enter the date or brand or both date and brand to search the whole workbook.
The macro will search the whole workbook with the criteria match will copy the Value 1.1 and Value 2.2 at both Value A and Value .
The copied value will paste in another workbook named Book02.xls at cell A1.
Case 1
Search for Date 1-JUN, the macro will copy all 1-JUN's Value 1.1 and Value 2.2 for Value A and Value B and paste in the Book02.xls start from the cell A1 to the right of the worksheet.
Case 2
Search for Brand name SONY. The macro will copy all SONY Brand's Value 1.1 and Value 2.2 for Value A and Value B and paste in the Book02.xls start from the cell A1 to the right of the worksheet.
Case 3
Search for Both Date and Brand for 1-JUN named ASUS. The macro will copy all 1-Jun, ASUS's Value 1.1 and Value 2.2 for Value A and Value B and paste in the Book02.xls start from the cell A1 to the right of the worksheet.
If the search continue in any case, the data will continue paste to the right side.
I had found some example over the internet, the example only search for 1 criteria, not for multi-criteria. and the search not run continuously. It will stop in every single search result.
I hope this time will have more people understand what I trying to ask. And I also hope that anybody can lead me with this, cause I had no idea how to write this macro.
Thank you.
From,
Anthony
Bookmarks