Change while loop from count to formula

H

hotherps

I would like to adapt the following code to use a formula to calculat
the value of 53, like the counter is doing below. For eac
"Currentcolumn" there is a countIf formula in row 8 when that formul
reaches 53 I want to stop adding the value "New" to each column.

What it does now is check the variable totalrow once and if it is les
than 53 it adds the value upto 53 and higher. I want to stop whe
totalrow(8) = 53

Thanks



Dim CurrentColumn As Integer, CurrentRow As Long, totalrow As Long
Count As Byte
With ActiveSheet

For CurrentColumn = 7 To 103
CurrentRow = 11
totalrow = 8
Count = 0
While Count < 53 And CurrentRow <= 298 And .cells(totalrow
CurrentColumn).Value < 53 If .cells(CurrentRow, CurrentColumn).Value
"." Then
.cells(CurrentRow, CurrentColumn).Value = "New"
Count = Count + 1 + totalrow
End If
CurrentRow = CurrentRow + 1
Wend
Next CurrentColumn
End Wit
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top