Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 4
Default Visual Basics Error - Goto

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
  #2   Report Post  
Posted to microsoft.public.excel.newusers
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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Meaning of On Error Goto 0 FARAZ QURESHI Excel Discussion (Misc queries) 5 May 4th 09 12:43 PM
Visual basics Moin Excel Discussion (Misc queries) 3 November 13th 07 05:59 PM
Can visual basics hide rows based on cell values? Jerrypetch Excel Discussion (Misc queries) 4 September 11th 06 07:21 PM
Visual Basics - Automating Specific Sheet Names Tenaj Excel Discussion (Misc queries) 9 October 6th 05 01:51 PM
Combo box in Visual Basics tamato43 Excel Discussion (Misc queries) 1 March 29th 05 01:26 AM


All times are GMT +1. The time now is 12:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"