Anomaly, can't format cell

S

Serge

Neight fom GUI nor VBA.

searched google groups found semi-solution:
<<
Type the number 1 in any empty cell (make sure that the
NumberFormat of the
cell with the number 1 is General or Number)
Copy it
Select all problematic date cells
Paste Special => Operation | Multiply
It worked. Question is why and how to fix it.
The cell formula contains RTD function.

Thank you.
 
T

Tom Ogilvy

The cells contains text instead of numbers. You can't format text (even if
it looks like a number).

What is the RTD function.
 
S

Serge

I see, thanks Tom. I modified RTD server code from
microsoft.
=RTD("Ticks.RTD","station1","IBM","LAST")

I noticed RTD method IRtdServer_RefreshData(TopicCount as
long) as Variant() returns variant type. Is variant type
causing client to display queries as text?
But then I tried using microsoft RTDTime example, I could
format that cell fine.

I would prefer not to use:
=(RTD("Ticks.RTD","station1","IBM","LAST")*1)

The way I populate cells is thru macro:
range("B" & i).formula = "=RTD..."
i=i+1
 
T

Tom Ogilvy

If you wanted it to be a number, I would use:

=(RTD("Ticks.RTD","station1","IBM","LAST")*1)

Not sure why you don't want to.


The lastest kick is
=--(RTD("Ticks.RTD","station1","IBM","LAST")

Maybe you will like that more.
 
S

Serge

You're right, I'll use your suggestion. It's just not all
tickers return back price and multiplying empty by 1
returns ugly #VALUE, but I guess I can handle it
differently.
 
T

Tom Ogilvy

Another approach would be to leave that formula alone and use the *1 when
you work with it

in A1 =(RTD("Ticks.RTD","station1","IBM","LAST")
similar in A2, A3

in A4

=A1*1 + A1*2 + A1*3

if you expect them to be numbers

or if you just want to format them, put the formulas in column A, then in B
put in

=if(iserror(A1*1),A1,A1*1)
You could then hide column A perhaps.

Formatting would only be meaningful when a number is returned.
 

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