View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default Cell Value is substituted for value in command

I have created a spreadsheet that allows me to click a button that
launches an RDP session from a computer listed in the spreadsheet. I
want to be able to highlight a cell with a computer name in it and
populate the value where servername appears now. In that way the user
only needs to choose the computer name and click the RDP button.

Private Sub CommandButton1_Click()
Call RDP_Click
End Sub

Sub RDP_Click()
Shell "c:\windows\system32\mstsc /v:servername /f"
End Sub

How do I modify the line that starts with Shell so that the user
launches the session with the value of the highlighted cell in the
spreadsheet. In other words, the highlighted cell replaces the
"servername" value above.