hi,
I have macro where I'm opening workbooks and for diffrent sheets I want to run code.
But I can't use Like. What should I do to use CASE function?
I have macro where I'm opening workbooks and for diffrent sheets I want to run code.
Code:
...
Set wb = Workbooks.Open(strPath2 & strFile2)
Dim myArray() As String
Dim myCount, NumShts As Integer
NumShts = wb.Worksheets.Count
ReDim myArray(1 To NumShts)
For myCount = 1 To NumShts
myArray(myCount) = wb.Sheets(myCount).Name
Next myCount
For Each ws In wb.Sheets
Select Case ws.Name
Case Like "*Software*"
'my code
Case Like "*Hardware*"
'my code
Case Else
'
End Select
Next ws
But I can't use Like. What should I do to use CASE function?