View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Joe Mathis Joe Mathis is offline
external usenet poster
 
Posts: 8
Default Stepping through a column using FOR/NEXT

Hello

I need to step through each cell of a particular column, check the contents to the previous cell, and then preform an action based on the outcome. Below is my code. Please help if you can

Thanks, Jo

With Worksheets("Source Data"
For i = 2 To .Range("e").Rows.Coun

If .Range("E" + i) < .Range("E" + (i - 1)) The

Range("e" + i).Selec
Selection.Cop
Worksheets("Gap").Range("b11").End(xlDown).Offset( 1, 0).Selec
Selection.PasteSpecial Paste:=xlPasteValue

.....etc

End I
Next i