ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Assign .value with the Mouse (https://www.excelbanter.com/excel-programming/303646-assign-value-mouse.html)

MAS

Assign .value with the Mouse
 
Hi,

I have established on another ng that just as I thought there is no way to
get an inputbox to close using code, its the ok button or the enter key or
nothing..

So back to code, is there a way other than inputbox to prompt the user to
click on the desired cell and once a selection is made for the code to move
on to the
next stage ? using the content of the selected cell to assign a value to a
variable.

MAS




Frank Kabel

Assign .value with the Mouse
 
Hi
one idea could be using the worksheet_selectionchange
event. e.g. put the following code in your worksheet
module:


Private Sub Worksheet_SelectionChange(ByVal Target As
Excel.Range)
If Intersect(Target, Me.Range("A1:A100")) Is Nothing _
Then Exit Sub
If Target.Cells.Count 1 Then Exit Sub

MsgBox Target.Value

End Sub

-----Original Message-----
Hi,

I have established on another ng that just as I thought

there is no way to
get an inputbox to close using code, its the ok button or

the enter key or
nothing..

So back to code, is there a way other than inputbox to

prompt the user to
click on the desired cell and once a selection is made

for the code to move
on to the
next stage ? using the content of the selected cell to

assign a value to a
variable.

MAS



.



All times are GMT +1. The time now is 05:02 PM.

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