Just started programming in VBA, I have a problem, and i don\'t know how to solve this. I think everything is ok. There shows Run-Time Error \'6\' Overflow when i want to ru
If you don't find the value koniec
before row 32767, your variable wiersz
will max out. If you want to continue past that, you should redefine it as Long.
You should also provide an exit for your loop, e.g. existing at the last used row. Instead of a do ... loop
, I usually use the following code:
Dim lLastRow As Long, lWiersz As Long
lLastRow = Cells(Rows.Count, kolumna).End(xlUp).Row
For lWiersz= 1 To lLastRow
Next lWiersz
you need to replace Dim object integer to long
like this
Dim wiersz As Integer -->>> Dim wiersz As long
Dim licznik As Integer -->>> Dim licznik As long