Transfer fixed width data from excel to text file

deepakgoyal2005

Board Regular
Joined
Sep 1, 2008
Messages
58
Hi,

I have an excel sheet with data of variable lengths in different column.
I need an aligned data in a text file. So I tried turning the data into fixed width with following formula in Column D4,

Code:
TEXT(A4,"00000") & B4 & REPT(" ",40-LEN(B4)) & TEXT(C4,"0000000.00")

Where,
Column A is a number
Column B is Text of maximum 40 characters
Cloumn C is amount field

Then, manually copy and paste the column with formula into a text file for final output. I want to avoid these steps being done by other teammates manually and avoid manual errors. So, want to do it through VBA Macro. Also since my data starts with Row 4 in excel sheet, I want to skip first 3 rows.

I, being not much comfortable with VBA, Can anyone please suggest something in this regards.
Thanks in advance :)
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,224,527
Messages
6,179,345
Members
452,907
Latest member
Roland Deschain

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