View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default 'Application.Goto Reference

Private Sub CommandButton1_Click()
On Error Resume Next
set rng = Worksheets("Sheet1").Range(Textbox1.Text)
On error goto 0
if rng is nothing then
' go to range A3
set rng = Worksheets("Sheet1").Range("A3")
' or go to the address contained in A3 of the current sheet
' set rng = Worksheets("Sheet1").Range(Range("A3").Value)
End if
Application.Goto Reference:=rng
End Sub

--
Regards,
Tom Ogilvy


"Jim Oswell" wrote in message
...
I am having trouble with

Private Sub CommandButton1_Click()
Application.Goto Reference:=Worksheets("Sheet1").Range = Textbox1.text or

$a$3.value
End Sub

where textbox1 or $A$3 is the intended goto cell name

Any ideas