#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 846
Default Fixed Width

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Fixed Width

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)



"Brad" wrote:

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 846
Default Fixed Width

Perfect!!! Thanks Joel

Have a great day.

Brad

"Joel" wrote:

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)



"Brad" wrote:

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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Column fixed width juanpablo Excel Discussion (Misc queries) 1 January 16th 08 12:57 PM
Fixed width fonts Also Excel Discussion (Misc queries) 3 January 8th 08 04:42 PM
Cells Fixed height and width Rayelle Excel Discussion (Misc queries) 1 January 23rd 07 12:19 AM
fixed width file? kwiklearner[_6_] Excel Programming 2 March 13th 06 08:59 PM
Fixed Width - Opening Certain Fixed Width Files Jan[_8_] Excel Programming 2 December 30th 03 08:31 PM


All times are GMT +1. The time now is 09:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"