Counter not working

Status
Not open for further replies.

jmersing

Well-known Member
Joined
Apr 14, 2004
Messages
887
I want to drop down to the next "currentrow" after the count reaches 16 and continue on from the "currentcolumn".

The only way the counter works is if I use end or exit sub, but that is not what I want to do.


Dim CurrentColumn As Integer, XColumn As Integer, CurrentRow As Long, Totalrow As Long, Count As Long
With ActiveSheet

CurrentColumn = 7
XColumn = 106
Totalrow = 299

Do Until CurrentColumn = 103
CurrentRow = 11
Totalrow = .cells(8, CurrentColumn).Value
''Count = 1
While Totalrow < Range("I383").Value And CurrentRow < 298

If .cells(CurrentRow, CurrentColumn).Value = "." Then
If .cells(CurrentRow, XColumn).Value = "x" _
And CurrentColumn >= 27 _
And .cells(CurrentRow, CurrentColumn).Offset(0, -1) <> "." Then
.cells(CurrentRow, CurrentColumn).Value = "LVD"
Count = Count + 1
If Count > 16 Then End '<<<<<<<<
Totalrow = Totalrow + 1

End If
End If
CurrentRow = CurrentRow + 1
Wend
CurrentColumn = CurrentColumn + 1
Loop
End With
Code:
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Status
Not open for further replies.

Forum statistics

Threads
1,203,140
Messages
6,053,725
Members
444,681
Latest member
Nadzri Hassan

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