Thread: loop
View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.misc
Christina Christina is offline
external usenet poster
 
Posts: 66
Default loop

Please bear with me. I am so basic. Would you please make adjustments to this.
Do
Range("F:F").Find(What:="Vendor ID", After:=ActiveCell,
LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlDown, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Select
ActiveCell.ClearContents
ActiveCell.Offset(1, 0).Select
Selection.Copy
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Select

Loop

End Sub



Thanks
"L. Howard Kittle" wrote:

At the very end of the code you will need to enter this required item:

End Sub

Enter it just below the last red line of code. So you will have something
like this


Sub MyMacro()

'all the code you want including Mike H's.

End Sub

If you have say only two consecutive lines of code that are red after a copy
and paste, then it means the code line has wrapped and you need to have a
line break OR put all that line of code on a single line.

To fix a red line wrap, go to the end of the upper red line of code and from
at very end do a SPACE and then an _ (underscore) then arrow up or down off
the line. Usually that will correct it but sometimes the line of code will
wrap at a place that will NOT accept a line break. If that happens best to
just put it all in one line and live with it being way off the screen, OR
you can put it all on one line and try different parts of the line to put
the space and underscore and hit enter. If you pick a proper place then the
code will compile and all the red will go away. You may have to try a few
different spots, when it does not compile go to the end of the upper red
line and hit delete to bring the bottom line back in place. (May have to
hit delete several times to get rid of the large space created when it
wrapped.

HTH
Regards,
Howard

"Christina" wrote in message
...
I need help with a loop. After looping through the procedure, when the
active cell is empty I want to exit the loop. Would you please give me
the
codes to do that.


Thanks


Cristina



.