Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello Group
I am programatically creating an excel work sheet loading the columns from fields in a Database file. The fields in the DB are defined as character but when the spread sheet gets created it drops the leading zeros. It assume the data is numeric but it is not. These leading zeros are required. Does anyone know how I can resolve this problem. I am using a program language called Visual RPG which is very similar to Visual Basic. Thanks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Open it as a text file
Suppose you have file 0001 A 0002 B 0003 C 0004 D 0005 E separated by any delimeter. (In my example it is tab). Lets say your file is "YourFie.txt" then the following code will do the job: Workbooks.OpenText Filename:="YourPath" & "\" & "YourFie.txt", _ Origin:=xlWindows, _ StartRow:=1, _ DataType:=xlDelimited, _ TextQualifier:=xlDoubleQuote, _ ConsecutiveDelimiter:=False, _ Tab:=True, _ Semicolon:=False, _ Comma:=False, _ Space:=False, Other:=False, _ FieldInfo:=Array(Array(1, 2), Array(2, 1)) FieldInfo says first column will be of type text. Ömer Ayzan "Ron K" wrote in message ... Hello Group I am programatically creating an excel work sheet loading the columns from fields in a Database file. The fields in the DB are defined as character but when the spread sheet gets created it drops the leading zeros. It assume the data is numeric but it is not. These leading zeros are required. Does anyone know how I can resolve this problem. I am using a program language called Visual RPG which is very similar to Visual Basic. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Leading Zero dropping off after export to Excel | Excel Discussion (Misc queries) | |||
How do I stop Excel from dropping leading zeros? | Excel Discussion (Misc queries) | |||
Dropping Zeros | Excel Worksheet Functions | |||
Converting xls to CSV file - dropping leading 0s | Excel Discussion (Misc queries) | |||
removing leading zeros in numeric fields | Excel Discussion (Misc queries) |