Mouse to Define Variable

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.
 
B

Bernie Deitrick

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top