Application.InputBox has annoying cursor key reactions

  • Thread starter Thread starter Dan Williams
  • Start date Start date
D

Dan Williams

I have learned to use the Application.InputBox method instead of the
InputBox function when I want to distinguish blank input from
Cancel/ESC.

But Application.InputBox seems to have other features that I wish I
could avoid. It seems to be intended for the input of ranges, even
when you set it up to expect a text string. When I set up the input
field to contain a default text string and I want to modify that
string, if I use any cursor key or the Home key or the End key, instead
of moving the text cursor to where I want it, it inserts a "+" sign and
some "R_C_" text describing the current range of the spreadsheet
cursor.

In other words, I can't re-aim the text cursor to the beginning,
interior, or end of a default string by using the keyboard; I must
always use the mouse and/or the Delete and Erase keys.

Can anyone confirm that there's no easy way around this? (I don't want
to set up a Form or do something really elaborate. It's not that
important.)

Dan Williams
danwPlanet
 
Dan,
Are you specifying that you want Text ? e.g.
Dim RetVal As Variant
Const TextOnly As Long = 2
RetVal = Application.InputBox("App InputBox Str Only", , "Dft Text", , , ,
TextOnly)

Arrow keys, Home, End work as expected.

nickHK
 
Nick -
Yes, I had tried it with the 2 in there. In fact, when I paste your
code into a test Sub, I still get the symptoms. Odd.
Dan
 
Well, the earlier suggestion works, so I'll go with that. Thanks for
trying it out!

In case anyone's inclined to snoop into the new mystery: I'm using
Excel 2000 and Windows 2000.
Dan
 
Dan said:
Well, the earlier suggestion works, so I'll go with that. Thanks for
trying it out!

In case anyone's inclined to snoop into the new mystery: I'm using
Excel 2000 and Windows 2000.
Dan
 
Back
Top