InputBox: Display Cell Content not Cell Ref ?

P

Peter Beach

Hi,

I presume you are referring to a RefEdit control? If so, I believe the
answer is "no". By design (not very good design, or at least not very good
implementation) this control is intended to identify a range in the sheet
and not its contents. If you wanted to you could build a form with a
RefEdit control and a text box and then have the text box display the
contents of the cell identified in the RefEdit control by trapping the
appropriate event.

Regards,

Peter Beach
 
M

MAS

Hi,

Could someone please clarify for me.

I have some code that brings up an InputBox at which point I click on the
appropriate cell, in this case a column of names, but rather than the name
appearing in the InputBox, I see the Cell reference i.e. $B$1.

I then click on OK and process the name in the code as I planned.

What I want to know is if there is a way to get the contents of the selected
Cell to show in the InputBox rather than the cell ref ?

If there is I will bet its something really simple that I have missed, but I
have conceded defeat ;-)

MAS
 
T

Tom Ogilvy

the only way to select a cell with an inputbox is to use

set rng = Application.InputBox(type:=8)

in that case, the inputbox returns a reference to the cell selected which is
what type:=8 specifies.

I don't believe there is a provision for selecting a cell and having the
inputbox display the value of the cell.

Maybe you want to create a userform that looks like an inputbox - this
should give you greater control over what happens.
 
M

MAS

Thanks guys,

At least it wasn't something simple that I was missing ;-)

I will have a go at forms another day...

The more I learn, the more I have to learn if you what I mean..

MAS
 
Top