VBA - Export Specific Column every 30 rows to .txt file

peternellza

New Member
Joined
May 5, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi VBA Wizards,

I have been battling to get this working. The purpose of this is that our customers need to enter a particular format to order in our b2b system. We have a problem with our ERP handling the .xml so limit the customer's orders in the b2b system to 30 lines per order. We would like to provide them with a template whereby they can enter the part number (column A), quantity (Column B) and this will concatenate in Column C as with a semicolon "A2;B2"

What I would like to achieve is to have a button the user can select once they have entered their data into Column A & B (Maximum 5001 lines) which will export the concatenated data into a .txt file splitting files every 30 rows but only where there is data contained in column A & B.

The user should be able to choose the destination to save the files that will be exported. There should also be no blanks or extra line in the .txt file.

I have tried so many methods and cannot get this working, just too complex for my understanding and skill level.

Many thanks !!

ArticleQuantityOutput Format
ABC10ABC;10
DEF5DEF;5
232441023244;10
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Hi,​
first, for such basic beginner level VBA procedure the 'Output Format' column is useless …​
Well elaborate how should be name the exported text files and where (particular location or in same workbook folder ?) …​
An attachment of an expected text file may help better …​
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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