View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Earl Kiosterud Earl Kiosterud is offline
external usenet poster
 
Posts: 611
Default Excel treating text as function

Bill,

Application.HyperactiveBehavior = False

Well, we can wish, can't we? This is one of Excel's hyperactive tricks. No
one, except a couple of programmers at Microsoft know why this is there.
Like automatic date formatting, it confounds more people than it helps.
It's actually a formula that Excel presumes is desired. Yet it appears to
be a bug, because if the cell is preformatted for text, it puts the cell
reference, as you said, but doesn't make it a formula (doesn't put = in
front of it as it does in a non-text-formatted cell).

Presumably the user wants only the - character in the cell, and wants to go
directly to another cell via an arrow key once it's been typed. After
typing the -, the user can press Enter, then use the arrow keys. Or precede
the - with an apostrophe ('). Or press F2 (Edit mode instead of Enter mode)
before typing the -. That's about the best I know of.
--
Earl Kiosterud
www.smokeylake.com

"Bill P" wrote in message
ups.com...
I am writing an Excel app in which the user needs to enter dashes
frequently ('-'). However, Excel thinks the user is trying to enter a
function, and if the user presses the down arrow, Excel inserts a
reference to that cell instead of moving down to that cell. Is there
any way to tell Excel not to expect a function? Setting the cell's
format to text doesn't work, and the Worksheet_Change event doesn't
fire until the user is finished editing the cell. Maybe there is some
property in the Application object I can set to fix this?

TIA,

- Bill