PDA

View Full Version : Solved: OnClick event



oliverralph7
08-01-2008, 12:11 PM
I am trying to create a command button that when click will go to Cell D51. Here is what I have so far.



Private Sub CommandButton1_Click(D51)
Range(Range("D51").Value).OnClick.Select
End Sub

kiyiya
08-01-2008, 12:45 PM
If it is on worksheet1 try:

Private Sub CommandButton1_Click()
sheet1.range("D51").select
End Sub

If it is not on worksheet1 then substitute sheet1 with which sheet it is on.

mdmackillop
08-01-2008, 02:40 PM
If the button and target are on the same sheet then


Private Sub CommandButton1_Click()
Range("D51").Select
End Sub