Exit Do Loop at Certain Cell?

VBE313

Active Member
Joined
Mar 22, 2019
Messages
395
Office Version
365
Platform
Windows
How do you exit a Do Loop at a certain cell?
 

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
8,613
Once you find the cell, place this code immediately below:
Code:
Exit Do
 

VBE313

Active Member
Joined
Mar 22, 2019
Messages
395
Office Version
365
Platform
Windows
Function Level5MakeMachineCost()
Application.Volatile (True)
r = Application.Caller.Row + 1
Do While Cells(r, "DU").Value <> "Yes"


If Cells(r, "EE").Address = "$EE$1001" Then Exit Do 'This is the line



Level5MakeMachineCost = Level5MakeMachineCost + Val(Cells(r, "EE").Value)
r = r + 1
Loop
End Function
 

Forum statistics

Threads
1,085,580
Messages
5,384,565
Members
401,909
Latest member
dlo1503

Some videos you may like

This Week's Hot Topics

Top