Export Data to CSV - ActiveX Command Button

iaindowner

New Member
Joined
Aug 12, 2014
Messages
18
I have a workbook which acts as a till system. What I need to be able to do is every time I press a button which says confirm payment I need to export the transaction to a Comma Seperated Value file. The information which I need to export is contained within specific ranges in every transaction and needs to be exported into the CSV in the following format:

Till Number, Server Name, Product Name, Quantity, Total Price, Current Date, Current Time

The transaction is contained for example in range A1:C5, column B being the product name, B the quantity and C being a vlookup formula which shows the product price.

E.g the transaction looks like this:
Product 13£3.00
Product 25£2.00
Product 41£6.00
Product 21£0.40

<tbody>
</tbody>

I want to export the info to look like this:

Till 1, Jack, Product 1, 3, £3.00, 9/9/14, 22:32
Till 1, Jack, Product 2, 5, £2.00, 9/9/14, 22:32
Till 1, Jack, Product 4, 1, £6.00, 9/9/14, 22:32
Till 1, Jack, Product 2, 1, £0.40, 9/9/14, 22:32

All the other information is contained within other ranges e.g Till number in D1, Server Name in E1 etc.

There will be multiple transactions so each file must save with a different filename i.e. Transaction#1, Transaction#2 etc.

Anyone's help will be greatly appreciated.
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,214,657
Messages
6,120,769
Members
448,991
Latest member
Hanakoro

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