Exporting a worksheet with blank/empty cells

G

Guest

I have a worksheet with 10,000 rows and 10 columns. In one of those columns
about 25% of the cells are empty. When I export the worksheet in a tab
delimited file those blank cells are simply omitted, so in those cases the
output record only has nine fields.

I need either to put something (the data in the column is numeric but always
=0) to indicate a blank (say -1) or to find some way to make the data export
put in two consecutive tabs with a blank between them representing the blank
cell.

Either solution would be OK, but I sort of prefer filling in the fields.
 
G

Guest

hi,
here is a ditty that might hellp....
Sub fillrange()
Dim r As Range
Dim rn As Range
Set r = Cells(1, 3)

For i = 1 To 10000 ' or whatever
Set rn = r.Offset(1, 0)
If IsEmpty(r) Then
r.Value = 0 ' or whatever
End If
Set r = rn
Next i
End Sub
adjust to fit your data/needs
Regards
FSt1
 
G

Guest

Thans for your help, tried it and works fine!



FSt1 said:
hi,
here is a ditty that might hellp....
Sub fillrange()
Dim r As Range
Dim rn As Range
Set r = Cells(1, 3)

For i = 1 To 10000 ' or whatever
Set rn = r.Offset(1, 0)
If IsEmpty(r) Then
r.Value = 0 ' or whatever
End If
Set r = rn
Next i
End Sub
adjust to fit your data/needs
Regards
FSt1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top