Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / September 2007

Tip: Looking for answers? Try searching our database.

Button to change view location

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Keith-NB - 26 Sep 2007 17:40 GMT
I dug around but didn't find this issue (although likely basic).  I'm no VBA
programmer so step by step help would be appreciated.

I have a multi-sheet workbook.  "Summary", "Detail1", "Detail2".

In the summary sheet, I would like to have three buttons:
1.  When pressed would move the user to view "Detail1" with cell A1 in the
upper left corner.
2.  When pressed would move the user to view "Detail1" with cell A1352 in
the upper left corner.
3.  When pressed would move the user to view "Detail2" with cell CC1219 in
the upper left corner.

This would greatly ease my use of excel for a collaborative presentation.  
Any help will be appreciated.  These community boards are awesome!

Best,
Keith
Tom Ogilvy - 26 Sep 2007 17:54 GMT
Application.Goto Range:=Worksheets("Detail1") _
  .Range("A1352"), Scroll:=True

would be in the click event of the button.  Just change the details of the
location to go to for each of the other.

Signature

Regards,
Tom Ogilvy

> I dug around but didn't find this issue (although likely basic).  I'm no VBA
> programmer so step by step help would be appreciated.
[quoted text clipped - 14 lines]
> Best,
> Keith
Keith-NB - 26 Sep 2007 21:32 GMT
Tom, thanks!

Just one last super-newbie thing.  Where do I put that?  

I can place the button, and then right click to "view code", select the
button and click, and get this:

Private Sub CommandButton1_Click()

End Sub

Everything I try from there doesn't work.  Sorry for the super newbie but
everyone starts somewhere.  Again, I dug around but didn't find the answer (I
tried a bunch but none worked).

Thanks!

> Application.Goto Range:=Worksheets("Detail1") _
>    .Range("A1352"), Scroll:=True
[quoted text clipped - 20 lines]
> > Best,
> > Keith
dan dungan - 27 Sep 2007 00:18 GMT
Hi Keith,

Did you try?:

Private Sub CommandButton1_Click()
Application.Goto Range:=Worksheets("Detail1") _
   .Range("A1352"), Scroll:=True
End Sub

Dan

On Sep 26, 1:32 pm, Keith-NB <Keit...@discussions.microsoft.com>
wrote:
> Tom, thanks!
>
[quoted text clipped - 41 lines]
> > > Best,
> > > Keith
Keith-NB - 27 Sep 2007 15:36 GMT
Dan, Team,
I did try the code below.  It ran but came back with an error of something
along the line of "invalid outside procedure", highlighting the A1352 text.

Any thoughts on why that would be and what I need to do to debug?

Thanks again to all for the assistance.

Best,
Keith

> Hi Keith,
>
[quoted text clipped - 54 lines]
> > > > Best,
> > > > Keith
dan dungan - 27 Sep 2007 17:04 GMT
Hi Keith,

When I tested this the error was "Named argument not found".

Try changing

Application.Goto Range:=Worksheets("Detail1") _
> >     .Range("A1352"), Scroll:=True

to

Application.Goto Reference:=Worksheets("Detail1") _
> >     .Range("A1352"), Scroll:=True

Dan

On Sep 27, 7:36 am, Keith-NB <Keit...@discussions.microsoft.com>
wrote:
> Dan, Team,
> I did try the code below.  It ran but came back with an error of something
[quoted text clipped - 65 lines]
> > > > > Best,
> > > > > Keith
Keith-NB - 27 Sep 2007 18:09 GMT
Dan,
I made the change and now get the following error:

Run time error '9'

subscript out of range.

VBA is awesome just painful sometimes.

Any help you can offer will be greatly appreciated.

Best,
Keith

> Hi Keith,
>
[quoted text clipped - 83 lines]
> > > > > > Best,
> > > > > > Keith
dan dungan - 27 Sep 2007 20:13 GMT
Keith,

Please copy the complete procedure here and let me know which line is
highlighted when it returns an error.

Dan

On Sep 27, 10:09 am, Keith-NB <Keit...@discussions.microsoft.com>
wrote:
> Dan,
> I made the change and now get the following error:
[quoted text clipped - 97 lines]
> > > > > > > Best,
> > > > > > > Keith
Keith-NB - 27 Sep 2007 20:24 GMT
Dan,
Here it is:
Private Sub CommandButton1_Click()
Application.Goto Reference:=Worksheets("Detail1") _
.Range("A1352"), Scroll:=True

End Sub

Pretty much exactly how it looks on the screen.

From A in Application through E in True is highlighted in the error message.

Thanks for your help with this.

Best,
Keith

> Keith,
>
[quoted text clipped - 106 lines]
> > > > > > > > Best,
> > > > > > > > Keith
dan dungan - 27 Sep 2007 21:08 GMT
Hi Keith,

The procedure works when I try it using Excel 2000 on Windows XP
professional.

What Excel version and operating system are you using?

Chip Pearson says, "This error typically occurs when you are
attempting to retrieve, by name, an item from a collection, and no
item by that name exists. For example, the following code will raise
an error 9 if there is no sheet named 'Sheet4'.

MsgBox Worksheets("Sheet4").Name"

Dan

On Sep 27, 12:24 pm, Keith-NB <Keit...@discussions.microsoft.com>
wrote:
> Dan,
> Here it is:
[quoted text clipped - 123 lines]
> > > > > > > > > Best,
> > > > > > > > > Keith
Keith-NB - 27 Sep 2007 21:32 GMT
Dan,
YEAH!!  That worked here too.

I had previously been testing it on Excel 2007 and Vista.

My older Excel 2000 and XP machine did it perfectly and that'll do.

Thanks for all your help.  I really appreciate it!

Best,
Keith

> Hi Keith,
>
[quoted text clipped - 141 lines]
> > > > > > > > > > Best,
> > > > > > > > > > Keith
dan dungan - 27 Sep 2007 23:47 GMT
Keith,

I'm glad that helped.

Dan

On Sep 27, 1:32 pm, Keith-NB <Keit...@discussions.microsoft.com>
wrote:
> Dan,
> YEAH!!  That worked here too.
[quoted text clipped - 153 lines]
> > > > > > > > > > > Best,
> > > > > > > > > > > Keith
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.