Excel VBA: Overflow error

前端 未结 2 2013
隐瞒了意图╮
隐瞒了意图╮ 2020-12-07 03:25

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

相关标签:
2条回答
  • 2020-12-07 03:37

    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
    
    0 讨论(0)
  • 2020-12-07 03:54

    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

    0 讨论(0)
提交回复
热议问题