Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default exporting data

Hello,

I am trying to export data to a text file... The problem is that the data
needs to be loaded as a string to preserve leading zeros but when i "Write"
the data to the file it puts "s in the data file...

Here is some code:
Dim c As Range
Dim intTemp As Variant
Dim strFileName As String
strFileName = "C:\FoodCost.Dat"
Open strFileName For Output As #1 ' Open file for output.

For Each c In Range("ItemRange")

intTemp = c.Cells(1, 8).Value
If c.Cells(1, 8).Value = "" Then GoTo NextItem

Write #1, CDec(intTemp)


NextItem:
Next
Close #1 ' Close file.

Here is an exerpt of the file:

"0000000367"
"0010000408"
"0030000588"
"0040000670"

the #s have to be 10 digits with leading 0s... any help would be great...

Ernst.

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
Exporting Data Brento Excel Discussion (Misc queries) 1 February 8th 06 02:20 PM
exporting a lot of data lwm11 Excel Worksheet Functions 3 October 28th 05 02:25 PM
Exporting Data Ket Excel Worksheet Functions 0 March 24th 05 01:10 PM
Exporting data Jane Excel Programming 2 March 17th 05 10:33 PM
Exporting data Govind[_3_] Excel Programming 0 December 27th 03 11:40 AM


All times are GMT +1. The time now is 09:48 PM.

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"