' Listing 3: Code That Creates the Hyperlinks Worksheet XL.Sheets.Add.Name = "HyperLinks" Row = 1 arrKeys = ServerAlerts.Keys() arrItems = ServerAlerts.Items() For i = 0 To ServerAlerts.Count - 1 XL.Cells(row,1).Value = arrKeys(i) idxcolor = arrItems(i) ' Chr(39) is needed in case there's a hyphen in the server name. HLink = Chr(39) & arrKeys(i) & Chr(39) & "!a1" XL.Range("A" & Row).Select XL.ActiveSheet.Hyperlinks.Add XL.Selection,"",HLink,"Link to " _ & arrKeys(i) ' ******* BEGIN CALLOUT A ******* If idxcolor = -4142 Then 'No tab color is defined. XL.Cells(Row,1).Font.FontStyle = "Bold" XL.Cells(Row,2).Value = idxcolor ' ******* END CALLOUT A ******* Else XL.Cells(Row,1).Font.Colorindex = WHITE XL.Cells(Row,1).Font.FontStyle = "Bold" XL.Cells(Row,1).interior.colorindex = idxcolor XL.Cells(Row,2).Value = idxcolor End If Row = Row + 1 Next ' ******* BEGIN CALLOUT B ******* XL.Cells.Select XL.Selection.Sort XL.Range("B1"),xlAscending,XL.Range("A1"),, _ xlAscending,,,xlNoHeader,1,False ' ******* END CALLOUT B ******* XL.Range("A1").Select SheetSorter ShowLegend XL.Range("A1").Select XL.Cells.EntireColumn.AutoFit XL.Columns("B:B").Select XL.Selection.EntireColumn.Hidden = TRUE XL.Range("A1").Select Msgbox "Done"