Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

value of a cell

Status
Not open for further replies.

NewbiDoobie

Technical User
Jul 25, 2005
63
US
I am not sure if there is a way to do this in excel, but if a user double clicks on a cell in a specific column, can I have the value of that cell passed to a macro to autofill another group of cells based on that value?
 
Yes you can. In the code module for the Worksheet of interest, include something like this procedure:
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
   Cancel = True
   MySub Target.Value
End Sub

In a standard code module you would have your procedure (macro) that you want to pass the value to. Example:
Code:
Sub MySub(ByVal vIn As Variant)

   MsgBox "vIn = " & vIn
End Sub


HTH
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top