Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Converting from Excel into a fixed length record
A simplified example of what I need to do.
I have the following cells in Excel A1=xxx, A2=yyyyy and A3=zzzzz which I need to convert in a fixed length record with offsets of 0, 5 & 13 so that it looks like this "xxx yyyyy zzzzz" If the field is a numeric I can use custom option to format the field to the appropriate no. of characters but how do I do this for an alpha field ? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Converting from Excel into a fixed length record
you can use the LEFT function
eg Sub testpad() MsgBox Pad("AB", 5) & "def" msgbox PAD(range("A1"),5) End Sub Function Pad(text As String, chrs As Long) As String Pad = Left(text & String(chrs, " "), 5) End Function "Gavin" wrote: A simplified example of what I need to do. I have the following cells in Excel A1=xxx, A2=yyyyy and A3=zzzzz which I need to convert in a fixed length record with offsets of 0, 5 & 13 so that it looks like this "xxx yyyyy zzzzz" If the field is a numeric I can use custom option to format the field to the appropriate no. of characters but how do I do this for an alpha field ? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Create an ASCII Fixed Length File from Excel | Excel Discussion (Misc queries) | |||
How do I export an Excel spreadsheet with fixed length rows? | Excel Discussion (Misc queries) | |||
Exporting from Excel to a Fixed Length Flat File | Excel Worksheet Functions | |||
Saving an EXCEL spreadsheet in fixed length format | Excel Programming | |||
fixed string length,even other record is copied | Excel Discussion (Misc queries) |