Hello and thanks to everyone - this is a very helpful Forum, increases my knowledge of VBA and saves hours of trial and error (although I try that first just to test what I do know )
Anyway, this one has got me stumped .....
I know I can't use (7?) characters in the Worksheet name i.e. \ / * [ ] : ? and obviously don't use them... ever.
However, I'm trying to use VBA to create and insert a Hyperlink into the activeWorksheet using Worksheet's name using the following VBA macro
Sub Insert_Link()
SheetName = ActiveSheet.Name
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
"'" & SheetName & "'!A1", TextToDisplay:="'" & SheetName & ""
ActiveSheet.Range("A1").Font.Color = vbBlue
End Sub
This works well for names like John Smith.... however Sean O'Brian fails no matter how I try to get around the ' in the Worksheet name.
This only appears to be a problem with the Hyperlink as all other VBA macro's I use are unaffected
Does anyone know how to overcome this??
Regards, George
Bookmarks