View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
marcus[_3_] marcus[_3_] is offline
external usenet poster
 
Posts: 140
Default VBA for comparing data within a range for Excel 2003

Hi

You don't need vba to solve this one. A formula will work just as
well. Put this in the appropriate cell and drag it down.

=IF(ISBLANK(D2),"",IF((AND((D2<B2),(C2<A2))),"Uptr end","Downtrend"))

VBA will do the job if you do not want to drag your formula to the
bottom of the range each time.

Take care

Marcus

Sub Fill()
Dim lw As Integer

lw = Range("D" & Rows.Count).End(xlUp).Row
Range("E2").AutoFill Range("E2:E" & lw)
End Sub