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 run this macro.
Sub Działaj()
Dim Tablica(1 To 5000) As String
Dim Dni()
Dim kolumna As Integer
Dim wiersz As Integer
Dim licznik As Integer
Dim PF As Boolean
Dim tmp As Integer
Dim i As Integer
Dim tmp2 As String
licznik = 2
tmp = 0
PF = False
kolumna = 22
wiersz = 2
Do
If Worksheets("Początkowe").Cells(wiersz, kolumna).Value <> vbNullString Then
For i = 1 To licznik
If Worksheets("Początkowe").Cells(wiersz, kolumna).Value = Tablica(i) Then 'debugger shows problem here i guess
PF = True
tmp = i
End If
Next i
End If
If Worksheets("Początkowe").Cells(wiersz, kolumna).Value = "koniec" Then
Exit Do
End If
wiersz = wiersz + 1
Loop
End Sub
Can anyone tell me where i made a mistake? I would be very grateful.
If Worksheets("Początkowe").Cells(wiersz, kolumna).Value = Tablica(i), but at no point in your code prior to that line do you assign a value to the array, so Tablica(i) at that stage is an empty string.