Hi,
I'm having some issue where a Do Loop is blowing past the point when it's supposed to stop. Once it hits a XXXXXXXX it should stop, but instead it keeps running until it hits the maximum of Excel records. I pasted the code below.
Any ideas?
I'm having some issue where a Do Loop is blowing past the point when it's supposed to stop. Once it hits a XXXXXXXX it should stop, but instead it keeps running until it hits the maximum of Excel records. I pasted the code below.
Any ideas?
Code:
Sub DRP_DOH_Report_Formatting()
Range("C65536:C65536").End(xlUp).Select
ActiveCell.Offset(1, 2).Select
ActiveCell.FormulaR1C1 = "XXXXXXXX"
ActiveCell.Offset(0, -4).Select
ActiveCell.FormulaR1C1 = "XXXXXXXX"
'POPULATE PLANT DESCRIPTION IN COL. F
Range("e1").End(xlDown).Select
Selection.Copy
ActiveCell.Offset(2, 0).Select
Range(Selection, Selection.End(xlDown).Offset(-1, 0)).Select
ActiveSheet.Paste
Do Until ActiveCell.Value = "XXXXXXXX"
Selection.End(xlDown).Select
Selection.Copy
Range(Selection, Selection.End(xlDown).Offset(-1, 0)).Select
ActiveSheet.Paste
Loop