View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.newusers
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Visual Basics Error - Goto

Either:

Private Sub CommandButton1_Click()
Application.Goto ActiveWorkbook.Sheets("WGTN & KAPITI").Range("Garry"), _
scroll:=true 'or false
End Sub

or

Private Sub CommandButton1_Click()
with ActiveWorkbook.Sheets("WGTN & KAPITI")
.Activate
.range("garry").Activate 'or .select
end with
End Sub

Shirl wrote:

Please help. I keep getting an error from my visual basics code. Click on a
button on a sheet takes you to another sheet within the same workbook then
directly to specific cells. Don't know whats wrong with the code.

Private Sub CommandButton1_Click()
Application.Goto ActiveWorkbook.Sheets("WGTN & KAPITI").Activate
ActiveSheet.Range("Garry").Activate
End Sub
--
Shirl, NZ


--

Dave Peterson