ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Inputbox used to return value of selected cell (https://www.excelbanter.com/excel-programming/280582-inputbox-used-return-value-selected-cell.html)

D.S.[_2_]

Inputbox used to return value of selected cell
 
Anyone know how I can use the inputbox so that the value of the inputbox is
determined by the cell I select with my mouse?

Donald



D.S.[_2_]

Inputbox used to return value of selected cell
 
Not exactly what I should have asked.

I'm trying to return the cell address to the input box when I select a cell
with the mouse.

D.S.

Donald
"D.S." wrote in message
...
Anyone know how I can use the inputbox so that the value of the inputbox

is
determined by the cell I select with my mouse?

Donald






Bob Phillips[_5_]

Inputbox used to return value of selected cell
 
Donald,

Using Application.Inputbox you can select a cell.

This code sets a cell to that value
myCell = Application.InputBox(prompt:="Select a cell", Type:=8)


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"D.S." wrote in message
...
Anyone know how I can use the inputbox so that the value of the inputbox

is
determined by the cell I select with my mouse?

Donald





Harald Staff

Inputbox used to return value of selected cell
 
Hi Donald

Not too sure I understand what you're after. But here's an inputbox that
prompts you to click a cell and returns the clicked cell and its address.
Who knows, maybe you need exactly that one day ?

Sub ClickACell()
Dim R As Range
On Error Resume Next
Set R = Application.InputBox("Click a cell:", _
Default:=ActiveCell.Address, _
Type:=8)
If R Is Nothing Then
MsgBox "cluck cluck"
Else
Set R = R(1)
MsgBox R.Address, , "A fine choice!"
End If
End Sub

--
HTH. Best wishes Harald
Followup to newsgroup only please

"D.S." skrev i melding
...
Not exactly what I should have asked.

I'm trying to return the cell address to the input box when I select a

cell
with the mouse.

D.S.




Bob Phillips[_5_]

Inputbox used to return value of selected cell
 
Donald,

Just tag .Address to the end.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Bob Phillips" wrote in message
...
Donald,

Using Application.Inputbox you can select a cell.

This code sets a cell to that value
myCell = Application.InputBox(prompt:="Select a cell", Type:=8)


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"D.S." wrote in message
...
Anyone know how I can use the inputbox so that the value of the inputbox

is
determined by the cell I select with my mouse?

Donald







D.S.[_2_]

Inputbox used to return value of selected cell
 
I think that's what I'm looking for. Forgot about <application.inputbox

D.S.

Donald
"Bob Phillips" wrote in message
...
Donald,

Using Application.Inputbox you can select a cell.

This code sets a cell to that value
myCell = Application.InputBox(prompt:="Select a cell", Type:=8)


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"D.S." wrote in message
...
Anyone know how I can use the inputbox so that the value of the inputbox

is
determined by the cell I select with my mouse?

Donald









All times are GMT +1. The time now is 08:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com