Loop find cell with value not working

lowej

New Member
Joined
Jun 30, 2018
Messages
8
Hello,

i have a little issue with a loop. it should loop through until it find a cell with a value, let say apple
and move through the rest of the loop. But when it gets to the value apple it's not doing anything and go's to the end.

Code:
        For w = 4 To lr - 1
            If IsEmpty(dbsheet.Cells(w, 1)) = False Then
                If dbsheet.Cells(w, 2).Interior.Color = lColor Then
                    x = x + 1
                    End If
                    If Databasesheet.Cells(y, 8) = 0 Then
                    GoTo nextrng
                    End If
            i = i + 1
            End If
        Next

How can i fix this issue??
thanks in advance
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Thanks for the reply.
the problem is with the first if statement isempty. I don’t know why but when it finds a value it go’s directly to end if
 
Upvote 0
Sorry please ignore. Read it wrong.
 
Last edited:
Upvote 0
i tested the loop with a new excel document and that works. So it seems that there is a issue with the cell.
the cell it self has a drop down list that is activated with a macro. Could the cause the issue ???
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,744
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top