ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Exporting a worksheet with blank/empty cells (https://www.excelbanter.com/excel-discussion-misc-queries/143542-exporting-worksheet-blank-empty-cells.html)

jjk98

Exporting a worksheet with blank/empty cells
 
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.
--
Thanks for your help - jjk98

FSt1

Exporting a worksheet with blank/empty cells
 
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

"jjk98" wrote:

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.
--
Thanks for your help - jjk98


jjk98

Exporting a worksheet with blank/empty cells
 
Thans for your help, tried it and works fine!



"FSt1" wrote:

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

"jjk98" wrote:

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.
--
Thanks for your help - jjk98



All times are GMT +1. The time now is 10:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com