View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
tom tom is offline
external usenet poster
 
Posts: 570
Default How to write a for loop to get the range between a ,b columns


Dim x,y As Integer

NumRows = Range("B3", Range("B3").End(xlDown)).Rows.Count

Range("C2").Select


For x = 1 To NumRows

For y= cells(A).value to cells(B).value
'which code we have to write for comparing a1,b1 are equal or not
ActiveCell.FormulaR1C1 = "=Sum(RC[-1]+1)"

ActiveCell.Offset(x, 0).FillDown
Next
Next