Question: i have a code that copies and rewrites anything thats between "(" and ")", but now i have different type of data which do not end with ")" so, i need it to stop when it reaches the last character in cell. Maybe it is dumb question but i cant seem to find how to fix my problem. I am a student and total newbie in vba (5 days ago i didn't know what vba is...) also sorry for my bad english.

I've tried to search (in here, google, youtube) but i couldnt find anything i need

```
'zaciatok=start koniec=end dlzka=length

Do While Mid(LookInHere, y, 1) <> ""

        If Mid(LookInHere, Z, 1) = "(" Then
        zaciatok = Z
        End If
        If Mid(LookInHere, y, 1) = ")" Then
        koniec = y
        dlzka = (koniec - 1) - zaciatok
        dlzka = Abs(dlzka)
        SplitCatcher = Mid(LookInHere, zaciatok + 1, CStr(dlzka))
        MsgBox SplitCatcher
        End If

        y = y + 1
        Z = Z + 1
Loop

```

Answer: 
In your specific implementation, one option is to modify your `Do While ...` loop to also test against the length of the string. That line would look something like:

```
Do While Mid(LookInHere, y, 1) <> "" And y < Len(LookInHere)

```

That modification tells the statement that it should terminate the loop when the iterating variable `y` goes past the length of the statement.

Another option is to change it from a `Do While` loop to a `For` loop. It would read something like:

```
For i = 1 to Len(LookInHere)
    MsgBox Mid(LookInHere, i, 1)
    'Input your logic here
Next i

```

The problem is that each of these versions is relatively inefficient, looping through each letter in a string a performing a calculation. Consider using built-in Excel functions. The `Instr` returns the position of a character, or a zero if it is not found. As an example, `Instr("Abcdef", "b")` would return the number 2, and `Instr("Abcdef", "k")` would return zero. You can replace the entire loop with these two function calls. 

```
Z = Instr(LookInHere, "(")
y = Instr(LookInHere, ")")
If y = 0 Then y = Len(LookInHere)

```

Final note: if your patterns begin to get more and more complex, consider reviewing and implementing regular expressions.
You can use `Right(LookInHere, 1)` to get the last character of `LookInHere`