View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
xavi garriga xavi garriga is offline
external usenet poster
 
Posts: 31
Default where is the mistake?

I know my programming level is low and sure the mistake is a begginers
mistake...I want to insert a row if the number in row i+1 is bigger than
number than number in row i.

The code I've written is this:

Private Sub CommandButton1_Click()
Dim i As Integer
For i = 1 To 10
If Worksheets("sheet1").Range("B" & i).Value <
Worksheets("sheet1").Range("B" & i + 1).Value Then
Rows("i:i").Insert Shift:=xlDown
End If
Next
End Sub


I can't find the mistake, can you help me????

Thanks!
--
atrep