Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Column fixed width | Excel Discussion (Misc queries) | |||
Fixed width fonts | Excel Discussion (Misc queries) | |||
Cells Fixed height and width | Excel Discussion (Misc queries) | |||
fixed width file? | Excel Programming | |||
Fixed Width - Opening Certain Fixed Width Files | Excel Programming |