Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default Automatically Assigning a Macro to a button

Wouldn't you be able to that with a hyperlink for the cell or
a HYPERLINK Worksheet Formula. See
Worksheets in VBA Coding and in Worksheet Formulas
http://www.mvps.org/dmcritchie/excel....htm#hyperlink

=HYPERLINK("#"&CELL("address",C5),C5)
=HYPERLINK("#"&CELL("address",sheetone!C5),sheeton e!C5)
=HYPERLINK("#"&CELL("address",'sheet two'!C5),'sheet two'!C5)

Additional possibilities in
http://www.mvps.org/dmcritchie/excel/buildtoc.htm
http://www.mvps.org/dmcritchie/excel/buildtoc2.htm

Just like in your web browser you can use the Back and Forward
buttons (Alt+ArrowLeft and Alt+ArrowRight) or the turquoise web
toolbar buttons you can install.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"David" wrote in message om...
Yes, thank you this line of code that you provided did the trick!,

Worksheets(ActiveSheet.Buttons(Application.Caller) .Caption).Select

The buttons are made from the forms toolbar. The program is for a
school project, it creates a table of sunrise and sunset times for a
given year using data from the US Naval Observatoy website. The
buttons are created on a cover sheet and will take you to any year
that has been created in the workbook. Thank you very much.


Dave Peterson wrote in message ...
Building on Bob's reply:

Option Explicit
Sub testme03()

On Error Resume Next
Worksheets(ActiveSheet.Buttons(Application.Caller) .Caption).Select
If Err.Number < 0 Then
MsgBox "Design error. Contact David!"
Err.Clear
End If

End Sub

These are buttons from the Forms toolbar, right????



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
Assigning a macro to a button hberg Excel Worksheet Functions 1 January 27th 10 10:31 PM
Assigning A Macro to A Button Holly Excel Worksheet Functions 1 January 18th 08 10:04 AM
assigning a macro to a button Darby Excel Discussion (Misc queries) 2 February 10th 06 05:05 PM
Assigning macro to button d Excel Discussion (Misc queries) 0 August 22nd 05 01:40 PM
Assigning a macro to a "button" Yvon Excel Discussion (Misc queries) 6 February 8th 05 10:58 PM


All times are GMT +1. The time now is 03:36 AM.

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"