Buongiorno,
Sono nuova nell'ambito VBA.
Volevo gentilmente chiedervi se potreste aiutarmi nel creare uno sheet index funzionante che contenga i collegamenti hyperlink ad altri sheet dello stesso Workbook.
Sono riuscita per gli sheet che non contengono righe o colonne nascoste, ma la macro da l'errore "Reference isn't Valid" se clicco sul hyperlink degli sheet che contengono righe e colonne nascoste(vedi screen).
Allego il mio codice che inserisco in ThisWorkbook:
Dim ReportNameCell As Range
Dim i As Integer
i = 1
For Each ws In ThisWorkbook.Worksheets
If ws.Visible <> xlSheetVeryHidden Then
i = i + 1
With ws
' add the sheet to the index
ThisWorkbook.Worksheets("Index").Cells(i, 2) = ws.Name
'Add hyperlink for easy access to other sheets from Index Sheet
ThisWorkbook.Worksheets("Index").Hyperlinks.Add Anchor:=ThisWorkbook.Worksheets("Index").Cells(i, 2), Address:="", SubAddress:= _
ws.Name & "!A1", TextToDisplay:=ws.Name
'Add report name next to its hyperlink
If Not .Cells.Find("Report:*", .Cells(.Rows.Count, .Columns.Count), -4123, , 1) _
Is Nothing Then Set ReportNameCell = .Cells(.Cells.Find("Report:*", _
.Cells(.Rows.Count, .Columns.Count)).Row, .Cells.Find("Report:*", _
.Cells(.Rows.Count, .Columns.Count), , , 2).Column)
ThisWorkbook.Worksheets("Index").Cells(i, 1) = ReportNameCell
Set ReportNameCell = Nothing
End With
End If
Next
Aspetto un vostro gentile riscontro.
Grazie mille anticipatamente.