elmnas
06-02-2015, 06:45 AM
Hello guys I have made following code below:
I have made an alert for the sheetname with wildcards
now I try to split the name into pieces, but I don't get it work why?
Sub Companyname()
'For i = 2 To ActiveSheet.UsedRange.SpecialCells(xlCellTypeLastCell).Row
Dim mySheetname As String
Dim splitTarget As String
For Each sht In ThisWorkbook.Worksheets
mySheetname = sht.Name
If sht.Name Like "kalle kalle*" Then
splitTarget = Split(mySheetname, "_")
MsgBox splitTarget
End If
Next sht
'Next i
End Sub
Thank you in advance
I have made an alert for the sheetname with wildcards
now I try to split the name into pieces, but I don't get it work why?
Sub Companyname()
'For i = 2 To ActiveSheet.UsedRange.SpecialCells(xlCellTypeLastCell).Row
Dim mySheetname As String
Dim splitTarget As String
For Each sht In ThisWorkbook.Worksheets
mySheetname = sht.Name
If sht.Name Like "kalle kalle*" Then
splitTarget = Split(mySheetname, "_")
MsgBox splitTarget
End If
Next sht
'Next i
End Sub
Thank you in advance