Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello everybody my question is about using hyperlinks from VBA I'd like to define a "next" and "previous" link in each worksheet of my workbook, so that the "next" link will move on next sheet in the workbook, while "previous" will activate the previous sheet. Since my workbook will consist of a lot of sheets that are copies of the same "master" sheet, my idea is to set the link info via VBA, in the Private Sub Worksheet_Activate() method.. In all the example I've found about using the Hyperlink, the hyperlink is to html or email... I've used this, but it does not work: Private Sub Worksheet_Activate() wsindex = ActiveSheet.Index wsprev = Worksheets(wsindex - 1).Name wsnext = Worksheets(wsindex + 1).Name MsgBox (wsprev & " " & wsnext) With ActiveSheet Hyperlinks.Add Anchor:=.Range("A1"), _ Address:=Worksheets(wsprev), _ ScreenTip:=wsprev, _ TextToDisplay:="PREVIOUS SHEET" End With With ActiveSheet Hyperlinks.Add Anchor:=.Range("b1"), _ Address:=Worksheets(wsnext), _ ScreenTip:=wsnext, _ TextToDisplay:="NEXT SHEET" End With What is wrong? thanks *pimar -- pimar ------------------------------------------------------------------------ pimar's Profile: http://www.excelforum.com/member.php...fo&userid=5386 View this thread: http://www.excelforum.com/showthread...hreadid=515090 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Hyperlink two sheets in a Excel Workbook | Excel Worksheet Functions | |||
hyperlink some 10 sheets in a workbook | Excel Discussion (Misc queries) | |||
Macro for filter on protected workbook that works for all sheets, no matter what sheets are named? | Excel Programming | |||
Intra-workbook hyperlink: macro/function to return to hyperlink ce | Excel Discussion (Misc queries) | |||
How to hyperlink from a workbook to sheets in another workbook? | Excel Worksheet Functions |