Hello,
I have made an enum to work properly.
Now i've found a problem on choosing the right enum.
can someone point me in the right direction ?
I'am reading an excell sheet, and need to convert the string into a number.
Don't want to use a select case.
Code:
   

Private Enum Chocolade
    Melk = 1
    Ganache = 2
    Fondant = 3
    Mokka = 4
End Enum

Private Enum Eclair
    Mini = 1
    Medium = 2
    Maxi = 3
    Groot = 4
End Enum

' some code here. Enums Eclair and Chocolade used.
For iCount = 1 To oXLees.Worksheets.Count
        strSht = oXLees.Worksheets(iCount).Name
        iTxt = InStr(1, strSht, " ")
         
        iVal = [eclair. & Trim(Mid$(strSht, 1, iTxt - 1))] 'error
        oXLsht.Cells(iCount, 1).Value = iVal
        strVal = Trim(Mid$(strSht, iTxt + 1))
        iVal = [Chocolade. & strVal] 'gives an error

        oXLsht.Cells(iCount, 2).Value = iVal
Next
' putting in Immidiate pane gives me error 2015 Or 2029