PDA

View Full Version : Macro To Browse Select File And Import Specific Data



Howardc
03-23-2013, 12:43 AM
I would like a macro to do the following

1) Open directory C:\Man_Accts so as to allow me to select a csv file that was downloaded (have had to save file as an excel file as site does not allow csv file to be uploaded KBRR_2013022
2) Once the csv file has been selected (see attached sample), I need the data in columns B:E to be copied from row1 to the destination workbook in sheet TBTXT in Col B:E from row3 onwards-I have copied the data manually into the destination workbook -sheet TBTXT to show you what it should look like after being copied using a macro



Your assistance in this regard is most appreciated

Charles
03-27-2013, 04:20 AM
Hi,

In this attachment you will see a button for test.
This will produce a Dialog box so you can select the file you want to retrieve the data from.
I used a filter in the code that will look for duplicates and only set the filter for the Item to be filtered.
The file you open must have a "Header" row else the code will not filter the data correctly.
It will copy the filtered range to the worksheet. In your example you have more data than the workbook you are copying from.
It's the last column in the attached workbook.
I hope this is close to what you want.

Howardc
03-27-2013, 07:10 AM
Hi Charles

Thanks for all your effort in writing the code-it works perfectly

andre.harrang@gmail.com
06-10-2013, 06:12 PM
Hi

I'am using your code as well and it is almost doing exactly what I want, but their are some question regarding the code:
1 - How do change so the listing start on f.eks. row 4 or 5
2 - How can I add a new sheet for each import. So if I import three different workbooks I will then end up with three sheets. One for each one.
(I'am planning to have a sheet as an overview where I will get the data from the imported workbooks/sheets)