LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default hyperlink to other sheets in the workbook using vba


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
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
Hyperlink two sheets in a Excel Workbook Krishna Excel Worksheet Functions 3 September 18th 07 02:46 PM
hyperlink some 10 sheets in a workbook anil Excel Discussion (Misc queries) 2 March 15th 07 01:19 PM
Macro for filter on protected workbook that works for all sheets, no matter what sheets are named? StargateFanFromWork[_3_] Excel Programming 6 January 26th 06 06:31 PM
Intra-workbook hyperlink: macro/function to return to hyperlink ce marika1981 Excel Discussion (Misc queries) 3 May 6th 05 05:47 AM
How to hyperlink from a workbook to sheets in another workbook? MJOHNSON Excel Worksheet Functions 0 February 17th 05 08:31 PM


All times are GMT +1. The time now is 07:36 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"