Luking for a VBA code to import datas of two csv files into excel sheet1 and sheet2 based on some conditions

faizumarali

Board Regular
Joined
Jul 23, 2008
Messages
89
Office Version
  1. 365
Platform
  1. Windows
I am attaching the files for your reference.

MASTER FILE

http://www.box.net/shared/dat9pgal4o


PAF FILE

http://www.box.net/shared/itz4dbg48h


PSI FILE

http://www.box.net/shared/cdj0szqhj3



My datas are in the path "C:\Temp"


I have three files named 0001.PAF, 0002.PSI & Master File.xls


The first two files (name of the file will be different each time) are basically CSV files but their extention changed from CSV to PAF & PSI respectively.


0001.PAF has the fields from column A to Column J.
The required fields in the context are Column B,E,F,G,H


0002.PAF has the fields from Column A to Column J (in which column E,F,G,H,I blank)
The required fields in the context are Column B & C



POINTS:

1. PAF Files contains the salary details of the employee Column G+H is the total salary of the employee
2. PSI file contains the name of the employee
3. There is 14 digit no in these two PAF & PSI files which is the employee id and is required to identify the correct employee and correct salary by using VLOOKUP function



My task is to import the data contained in two files that is 0001.PAF & 0002.PSI (basically CSV file only the extension different) into sheet1 and sheet2 of Master File.xls based on the follwoing conditions

1. The data should be imported after using the VLOOKUP function, so as to ensure the accuracy of the data
2. Employee Name should be sorted in the alphabetical order
3. Salary amount should be the total salary ie G+H from PAF FILE
4. Total Salary should be splitted into currency denomination of 500,100,50,20,10,5,1
5. The data should have Header (The co name in the header is there is the last name in PSI file)
6. The data should have Footer (The data always: SALARY PAYOUT by: XYZ CO LTD
7. The alignment and format of the data should be as per the Master File



Kindly note my Output file Master File.xls for your refenece



Thank you all for going through my post. Awaiting for a solution. Thank you.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
First time ever, i didn't get a reply from the forum, a bit disappointed.:(
:(
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top