Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default From Cell to InputBox

Greetings !

My code, after a "button" is pressed, throws an InputBox
onto the screen.

I want in reply to insert a value already displayed in a
Cell.

This I can do by selecting the cell before hand, pressing
F9 and then Ctrl C followed by Esc. Then I click on
the "button", and press Ctrl V at the InputBox.

That's fine for one value, but the InputBox is followed by
another, into which I want to paste the value from another
cell.

Yes, I COULD type it in - but that's not a satisfactory
solution !

I guess one way would be to type in the Cell Reference -
but is there a way that I could click on the required
Cell ?

There are ocasions when (say) "G72" would be a valid
answer, when I actually want the VALUE in that Cell (which
might be "J136", say)


RClay AT haswell DOT com
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default From Cell to InputBox

Dim rng as Range
On Error Resume Next
set rng = Application.InputBox("Select cell with mouse", Type:=8)
On Error goto 0
if not rng is nothing then
vVal = rng(1).value
else
msgbox "you hit cancel"
End if

This will get a reference to the selected cell or you can type in an
address. You can't type in the value, however.

Once you have the cell reference, your code can use the value of that cell.

--
Regards,
Tom Ogilvy


"Robin Clay" wrote in message
...
Greetings !

My code, after a "button" is pressed, throws an InputBox
onto the screen.

I want in reply to insert a value already displayed in a
Cell.

This I can do by selecting the cell before hand, pressing
F9 and then Ctrl C followed by Esc. Then I click on
the "button", and press Ctrl V at the InputBox.

That's fine for one value, but the InputBox is followed by
another, into which I want to paste the value from another
cell.

Yes, I COULD type it in - but that's not a satisfactory
solution !

I guess one way would be to type in the Cell Reference -
but is there a way that I could click on the required
Cell ?

There are ocasions when (say) "G72" would be a valid
answer, when I actually want the VALUE in that Cell (which
might be "J136", say)


RClay AT haswell DOT com



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
Returning a cell address in a msgbox, by selection via inputbox Ty FARAZ QURESHI Excel Discussion (Misc queries) 3 April 8th 09 12:57 PM
InputBox to select cell locations Michael M Excel Worksheet Functions 5 February 21st 06 05:18 PM
Inputbox with VBA Jeff Excel Discussion (Misc queries) 3 January 19th 06 05:18 PM
Inputbox used to return value of selected cell D.S.[_2_] Excel Programming 5 October 25th 03 06:53 PM
Inputbox to return address of cell selected by mouse D.S.[_2_] Excel Programming 2 October 25th 03 06:48 PM


All times are GMT +1. The time now is 09:12 AM.

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

About Us

"It's about Microsoft Excel"