View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Atishoo Atishoo is offline
external usenet poster
 
Posts: 267
Default command button sub

thank you!!

"Jim Thomlinson" wrote:

What is target? Event subs have target as a parameter. Yours does not define
target anywhere. Perhaps activecell

Private Sub CommandButton3_Click()

If Not Intersect(activcell, Range("patientlist")) Is Nothing Then
UserForm2.TextBox1.Value = ActiveCell.Value
UserForm2.Show
End If

End Sub
--
HTH...

Jim Thomlinson


"Atishoo" wrote:

Hi why wont this work for a command button, what should I write instead?

Private Sub CommandButton3_Click()

If Not Intersect(Target, Range("patientlist")) Is Nothing Then
UserForm2.TextBox1.Value = ActiveCell.Value
UserForm2.Show
End If

End Sub