View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
MrShorty[_8_] MrShorty[_8_] is offline
external usenet poster
 
Posts: 1
Default Skipping cells in a Do Until loop


What's contained in C69? Is it empty/blank?

This is just an educated guess; I don't have a lot of experience wit
VBA. What little experience I have suggests that the conditional:
Until rgCopy = wsCopy.Range("C69") without any specification of exactl
what to compare in each range will compare the cells' values. So
assuming C69 is blank, when it finds a blank cell, blank=blank return
true, and it ends the loop. Step through a loop, with Watches fo
rgcopy and wscopy.range("C69") and rgcopy=wscopy.range("C69") and se
when the comparison returns TRUE.

If it were me, I would make the comparison more explicit as to when
wanted it to stop to avoid the ambiguity. Maybe something like Unti
rgcopy.row =69 or Until rgcopy.row=wscopy.range("C69").row t
explicitly state that I'm looping on the row number and not some othe
condition

--
MrShort
-----------------------------------------------------------------------
MrShorty's Profile: http://www.excelforum.com/member.php...fo&userid=2218
View this thread: http://www.excelforum.com/showthread.php?threadid=38205