kathanayakudu Posted April 29, 2014 Report Posted April 29, 2014 Can you help me with this. I need to repeat rows like this: 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 .... up to 200 Is there a way to do it? I tried to point cursor in the corner and drag it but it's only repeating those 1,2,3 and 4. I need sets like this up to 200.
ringa_ringa Posted April 29, 2014 Report Posted April 29, 2014 Click developer, open visual basic and put this code Hit run __________ Code: __________ Sub numbers() Range("A1").Select ActiveCell.FormulaR1C1 = "1" Range("A2").Select ActiveCell.FormulaR1C1 = "1" Range("A3").Select ActiveCell.FormulaR1C1 = "1" Range("A4").Select ActiveCell.FormulaR1C1 = "1" For i = 1 To 796 Selection.Offset(1, 0).Select ActiveCell = "=R[-4]C+1" Next i End Sub 1
kathanayakudu Posted April 29, 2014 Author Report Posted April 29, 2014 Click developer, open visual basic and put this code Hit run __________ Code: __________ Sub numbers() Range("A1").Select ActiveCell.FormulaR1C1 = "1" Range("A2").Select ActiveCell.FormulaR1C1 = "1" Range("A3").Select ActiveCell.FormulaR1C1 = "1" Range("A4").Select ActiveCell.FormulaR1C1 = "1" For i = 1 To 796 Selection.Offset(1, 0).Select ActiveCell = "=R[-4]C+1" Next i End Sub YOU ARE AMAZING. THANKS!!! ()>>
cherlapalli_jailer Posted April 29, 2014 Report Posted April 29, 2014 Click developer, open visual basic and put this code Hit run __________ Code: __________ Sub numbers() Range("A1").Select ActiveCell.FormulaR1C1 = "1" Range("A2").Select ActiveCell.FormulaR1C1 = "1" Range("A3").Select ActiveCell.FormulaR1C1 = "1" Range("A4").Select ActiveCell.FormulaR1C1 = "1" For i = 1 To 796 Selection.Offset(1, 0).Select ActiveCell = "=R[-4]C+1" Next i End Sub good one thax Bro
Mr_PapaRayudu Posted April 29, 2014 Report Posted April 29, 2014 Click developer, open visual basic and put this code Hit run __________ Code: __________ Sub numbers() Range("A1").Select ActiveCell.FormulaR1C1 = "1" Range("A2").Select ActiveCell.FormulaR1C1 = "1" Range("A3").Select ActiveCell.FormulaR1C1 = "1" Range("A4").Select ActiveCell.FormulaR1C1 = "1" For i = 1 To 796 Selection.Offset(1, 0).Select ActiveCell = "=R[-4]C+1" Next i End Sub Ila raasthunna pani chesthundhi man.... Sub numbers() Range("A1").Select ActiveCell.FormulaR1C1 = "1" For i = 1 To 799 Selection.Offset(1, 0).Select ActiveCell = "=R[-4]C+1" Next i End Sub I was just playing with your code.
Recommended Posts