so I have found a great answer on here showing how to get the values or strings between brackets (Get the value between the brackets) The code works perfectly, but when square brackets are involved, as in the following code, it gives me an error which I have been trying to fix for this whole day. I cannot seem to figure out what my problem is. The error notification I get is: "Run-time error '5': Invalid procedure call or argument"
For i = 6 To Worksheets(FileName).UsedRange.Columns.Count
kursName = Worksheets(FileName).Cells(1, i).Value
klammerAuf = InStr(kursName, "[")
klammerZu = InStr(kursName, "]")
Cells(3, i) = Mid(kursName, klammerAuf + 1, klammerZu - klammerAuf - 1)
Next i