Mouse to Define Variable

  • Thread starter Thread starter MAS
  • Start date Start date
M

MAS

Hi,

Just taking my first steps back to VBA..

I want to prompt users to click on a staff members name in a worksheet and
assign the result of that mouse click to the variable StaffName.

Please point me in the direction of the correct Function.
 
MAS,

Sub TryNow()
Dim StaffName As String

StaffName = Application.InputBox( _
"Select the cell with the Staffer's Name", _
"Select the Name", , , , , , 8).Value

MsgBox StaffName

End Sub

HTH,
Bernie
MS Excel MVP
 
Back
Top