Alright so you can do the following:
Sub get_sheet_name_into_letters()
Dim sheetname As String
Dim char As String
Dim iteration As Integer
Dim totchar As Integer
Dim myrange As Range
Dim result As Double
Dim hlinkname As String
Dim check As Integer
'this is just an example to check if the character is a letter. I just created a column with the letters of the alphabet
Set myrange = Application.Range(Cell1:="G1", Cell2:="G26")
'get the sheet name
sheetname = ActiveSheet.Name
sheetname = WorksheetFunction.Substitute(sheetname, " ", "")
'this loop checks whether the
iteration = 1
totchar = Len(sheetname)
'this sets the first variables
char = Mid(sheetname, iteration, 1)
hlinkname = char
iteration = iteration + 1
Do Until iteration > totchar
check = Asc(char)
If Asc(char) > 122 Or Asc(char) < 65 Then
char = ""
Else
char = Mid(sheetname, iteration, 1)
End If
hlinkname = hlinkname & char
iteration = iteration + 1
char = Mid(sheetname, iteration, 1)
Loop
End Sub
This should help you get any sheet name with letters in it, ignore special characters and get you the string to create the hyperlink. Hope this helps or guides you to getting it.
Bookmarks