Problem with formating
Got it.
..NumberFormat = "@"
Thanks
"DG" wrote in message
...
I found it.
I was manually formating the column to text BEFORE I ran the macro. At
the begining of the macro I have:
With Range("A8:K10000")
.Clear
End With
which removed the format. When I comment this out my macro works.
Problem is that I need that clear. So Can you tell me how to format column
I as text?
DG
"DG" wrote in message
...
Hi Peter,
I ran your script and it put 20080418100810 in cell A1 with the warning
that I have a number foratted as text in the cell.
DG
"Peter T" <peter_t@discussions wrote in message
...
Seems slightly strange your string is being coerced to a number in a
cell
that you say is already formatted as text. What happens if you run
this -
s$ = Format(Now, "yyyymmddhhmmss")
With ActiveCell
.NumberFormat = "@"
.Value = s
End With
Regards,
Peter T
"DG" wrote in message
...
I have an array that contains string values. When I put one of these
values
into my spreadsheet it changes to Scientific.
Dim DataRow(12)
DataRow(9)="201E-13" ' for this example
Line = 2 ' for this example
Sheets("Sheet2").Cells(Line,9) = DataRow(9)
The result in Sheet2 I2 = 2.01E-11 and the format is Scientific. I
manually
set this column to text before running the macro.
Any help would be great.
DG
|