|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
From within an Excel macro I am trying to automatically generate a series of HTML links on the 1st Worksheet of an Excel Workbook which point to a variable numer of subsequent worksheets. (See code attached)
The problem I have is that I can easly see how to create links to external locations but can't find the right reference format to point to internal lWorkbook locations. Can any one help? For i = 2 To Sheets.Count With Worksheets("Main") Cells(i + 6, 4).Value = Sheets(i).Name .Hyperlinks.Add Anchor:=.Cells(i + 6, 4), Address:=Worksheets(i).Name End With For rwIndex = 1 To 1000000 With Worksheets(i).Cells(rwIndex, 1) If .Value = "Total" Then Worksheets("Main").Cells(i + 6, 6).Value = Worksheets(i).Cells(rwIndex, 6) Worksheets("Main").Cells(i + 6, 8).Value = Worksheets(i).Cells(rwIndex, 8) rwIndex = 1000000 End If End With Next rwIndex Next i |
|
#2
|
|||
|
|||
|
Hello,
I have just recorded a macro to insert a hyperlink and this is the code in the macro. Code:
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _ "Sheet1!A2", TextToDisplay:="Sheet1!A2" HTH, Alan. |
![]() |
| Viewing: ASP Free Forums > Other > Programming Help > Excel Macro Problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|