Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
DG DG is offline
external usenet poster
 
Posts: 46
Default 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










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
Formating problem Nils Titley Excel Programming 6 March 22nd 08 10:57 PM
Formating Problem Dave Excel Discussion (Misc queries) 1 January 28th 08 01:02 PM
formating problem, PLEASE help. guy12345 Excel Discussion (Misc queries) 5 August 31st 06 05:50 PM
VBA Conditional Formating Problem Yogi_Bear_79 Excel Programming 0 June 6th 05 07:50 PM
Date formating problem Kiknadze Lado Excel Programming 2 August 24th 04 01:06 PM


All times are GMT +1. The time now is 06:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"