Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

VBA macro to search a "textbox value" in another xlsx file, get data from several columns in the same row, before and after the searched value.

0

Hi guys,

I hope that I can explain right what I need or looking for.

I'm exporting a data from my ERP system to a excel file and I need to use it to do a report.

The problem that my repport will have only 13 columns and the ERP file has more than 66.

The main value which I want to use to search is the "ID" value that is located on columns 25 from the ERP file.

What I'm looking for a solution is: When I put the ID value on a "Textbox1" and click on the command button "IMPORT", I want to search the value on COLUMN 25 from ERP file, and print out the data from columns (10, 12, 16, 7, 13, 17, 2, 14, 9, 22, 24 and 19) in the same row to my ActiveWorkbook on the activerow columns from 4 to 15.

Answer
Discuss

Discussion

Hi,
Please prepare a sample workbook with about 30 rows of real data from column 25 of your ERP workbook. Also prepare a template for the report that you wish to create, including the TextBox that you want to use to enter the search criterium. Attach both workbooks to your question. You can do that in Edit mode.
Variatus (rep: 4889) Aug 10, '21 at 8:24 pm
Add to Discussion



Answer the Question

You must create an account to use the forum. Create an Account or Login