Correctly spacing output

JamesgTx

New Member
Joined
Jan 6, 2010
Messages
25
Help! I have a VBA macro where I am creating an output text file. I have to correctly space the entries of each line.

Is there a function to add spaces to an output line?

For example here is part of the code

For i = 10 To 39
iENUM = i
iEN1 = i
iEN2 = i + 1
Print #intFH, Space(4), iEN1, Space(4), iEN2, Space(41), "1", Space(5), "1", Space(5), "1", Space(5), "1", Space(10), iENUM
Next i

I have iENUM,iEN1, and iEN2 dimensioned as integers. Right now I am getting way too many spaces between entries in the line.

Is the Space command the culprit?

Any help is greatly appreciated
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,224,502
Messages
6,179,126
Members
452,890
Latest member
Nikhil Ramesh

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