I have a case statement and I am trying to search for part of a sentence in a string so that I can use that in my case. I am thinking that I will need to use a length function and get the part of gthe string I want that way. Heres the code that I am using minus the length method.
fName = c:\file.xls
sheetName = fName 'fName has the whole string and sheetName should equal the partial string which is file
Select Case sheetName
Case file
ws.Name = "file"
Case dinner
ws.Name = "Dinner"
Case nc
ws.Name = "NC"
Case pc
ws.Name = "PC"
Case Else
'more possibilities?
End Select
fName = c:\file.xls
sheetName = fName 'fName has the whole string and sheetName should equal the partial string which is file
Select Case sheetName
Case file
ws.Name = "file"
Case dinner
ws.Name = "Dinner"
Case nc
ws.Name = "NC"
Case pc
ws.Name = "PC"
Case Else
'more possibilities?
End Select