I am having trouble resolving this issue regarding
application-defined or object-defined error
My codes as below
Dim intX as integer
Dim Uname As String
Dim Pword As String
Dim Epin As String
intX = 9
Uname = Cells(intX, 5)
Do
If Cells(intX, 4).Value > 0 Then
Uname = Cells(intX, 5)
Pword = Cells(intX, 6)
Epin = Cells(intX, 7)
Else
GoTo Skips
End If
'Bunch of codes
Skips:
intX = intX + 1
Err_Clear:
If Err <> 0 Then
Err.Clear
Resume Next
End If
Loop Until IsEmpty(Uname)
My table basically has a column of login infos and a column of yes no being informed via a 1 = yes and 0 or null = no system, so if the cells(intX,4) has a 1, it will perform the bunch of codes
Uname or Cells(intX,5) has value until the end (or empty cell)
The code runs perfectly until the final loop (it finishes the task but return a application -defined or object-defined error hence the code won't run after the Loop Until IsEmpty(Uname)
The error points to
If Cells(intX, 4).Value > 0 Then
Any help please?
intX(curious name for aLong) is higher than the number of available rows. - RoryintXand ofCells(intX,4)when the error occurs? I suspect @Rory answer to be correct, as you do not seem to have any upper bound for checking intX. - Ron Rosenfeld1.Are you usingOption Explicit?2.Can you update the code by showing the variable declarations with their specific data type for the purpose their being used? - bonCodigo