Fixed Width

G

Guest

Thanks for taking the time to read my question.

I'm working with a fixed width text file. I want to add x number of spaces
after my value without having to do a loop. Is there a good way to do this?

I'm using Print #1, Sheets(SheetName).Cells(RowNum, 1) & " " &
Sheets(SheetName).Cells(RowNum, 2) to write to the file. So I can use
len() to get the len of the value and then just add x spaces to make up the
difference.

Thanks,

Brad
 
G

Guest

the VBA string function does exactly what you want it to do. let the
character be " "

Returns a Variant (String) containing a repeating character string of the
length specified.

Syntax

String(number, character)
 
G

Guest

Perfect!!! Thanks Joel

Have a great day.

Brad

Joel said:
the VBA string function does exactly what you want it to do. let the
character be " "

Returns a Variant (String) containing a repeating character string of the
length specified.

Syntax

String(number, character)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top