Excel VBA - Creating a CSV file with value from 2 sheets

Golaidron

Board Regular
Joined
Jan 23, 2013
Messages
83
Office Version
  1. 365
Platform
  1. Windows
Hi guys.
I'm not sure if this is technically possible, but I ask you experts anyway.

I want to create a .csv file with values from 2 different sheets and a freetext.
Sheet 1 = Master
Sheet 2 = Solution
Column A in both sheets has the same information and that is my customers name.
The criteria for retrieving data is that in the Solution sheet column AN = No and the number value in column AF is greater than 0 (if the value in AF is text, then ignore)

CSV setup.
Data 1, data 2, data 3, data 4
Data 1 is located in Solution in column AF
Data 2 is a free text = Solution 1 (the same for everyone)
Data 3 is located in Solution in column A
Data 4 is located in the Master in column G

I also want to be able to name the csv file and save it under a specific folder in the code.
Let's say i want the file to be name Customers.csv for now.
Location for it to save is: C:\Golaidron\Customer
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Forum statistics

Threads
1,213,546
Messages
6,114,256
Members
448,558
Latest member
aivin

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