J
jimicl
hi,
Well, Greeting from Chile, in this moment i've been working in a
macro that insert a row when a series of number in ascendent order,:
macro
ex: 1 1
1 1
1 1
2
3 2
4
4 3
5
4
4
5
but i have some problems with the result:
1)it does an endless loop
2)and it does something like this:
1
1
2
3
4
4
3) it doesn't work with numbers over 8 digits
What's wrong?
here's the macro
C = 4
D = 5
E = "1"
Do While E <> " "
Cells(C, 2).Select
A = ActiveCell.FormulaR1C1
Cells(D, 2).Select
B = ActiveCell.FormulaR1C1
Do While A = B
Cells(C, 2).Select
A = ActiveCell.FormulaR1C1
Cells(D, 2).Select
B = ActiveCell.FormulaR1C1
C = C + 1
D = D + 1
Loop
If B > A Then
Selection.EntireRow.Insert
C = C + 2
D = D + 2
Else
E = " "
End If
Loop
End Sub
Someone can help me!
thank u
JIMICL
Well, Greeting from Chile, in this moment i've been working in a
macro that insert a row when a series of number in ascendent order,:
macro
ex: 1 1
1 1
1 1
2
3 2
4
4 3
5
4
4
5
but i have some problems with the result:
1)it does an endless loop
2)and it does something like this:
1
1
2
3
4
4
3) it doesn't work with numbers over 8 digits
What's wrong?
here's the macro
C = 4
D = 5
E = "1"
Do While E <> " "
Cells(C, 2).Select
A = ActiveCell.FormulaR1C1
Cells(D, 2).Select
B = ActiveCell.FormulaR1C1
Do While A = B
Cells(C, 2).Select
A = ActiveCell.FormulaR1C1
Cells(D, 2).Select
B = ActiveCell.FormulaR1C1
C = C + 1
D = D + 1
Loop
If B > A Then
Selection.EntireRow.Insert
C = C + 2
D = D + 2
Else
E = " "
End If
Loop
End Sub
Someone can help me!
thank u
JIMICL