PDA

View Full Version : Import data from csv with open Dialogue box



Arshmaan
2011-10-20, 01:07 PM
hello all..

i need some help in excel vba.. i want to import data in my excel sheet which is in 4 .csv files..

i want to do this with a command button_click command... with open dialogue box then select range where to import data. the csv file contains 5 columns and i need 4 (abcd)..

can anybody help me out?

Ken Puls
2011-10-21, 03:58 AM
Yes, but we'll need more info.

Do you want to browse to locate the file?
Will you always be only importing the first 4 columns?
Where do you want to put that data? And exisiting worksheet, new worksheet...?

Give us as much info as you can on what you'd like to do.

Arshmaan
2011-10-21, 05:31 AM
Thanks for your reply Ken... yes here's the info.

yah i want to locate the file, and i need 4 column always... and i need the data in existing worksheet..

actually the data is something like that...

column A - Name, column B - MSISDN, column C - Dated, and column D - Remarks

now i want to import first 3 columns (A, B and C) then left 2 columns blank (D and E) and then import the 4th column (column D in CSV) to Column F in my worksheet.. hope you understand

thanking you

Arshmaan
2011-10-27, 06:44 AM
No Replies :( please can anybody help me ?

Ken Puls
2011-10-27, 06:53 AM
Sorry Arshmaan, I missed your post while working on other things.

Can you start by recording a macro going through your import/copy steps, then post the code here? I'll edit the code to make it more efficient/dynamic, and put in the ability to browse to a different file.