I have recorded this macro in excel. The idea is to go through all rows (100) and repeat the SUB. I think i figured the proper algorithm (I have basic Turbo Pascal knowlege).
Here is my algorithm:
Create a loop that is using a variable, i, for counting. For i from 2 (we start from row 2, row 1 has headers) to 200 (even if we initially have 100 rows by the time the scrip will finish executing we will have doubled the amount of rows)
Do the sub
How do I make Rows("2:2") for example to reference the current value of i.
How do Rows("3:3") to use the value i+1.
How do I make Range("B2") to use the value B(i)
I am stuck with the loop and the proper syntax Please help. Also since I want to get deeper into the topic could you please suggest some good sources? I was not really interested in coding after during high school, but now I want to get deeper into the topic.
Sub Macro2()
Rows("2:2").Select
Selection.Copy
Rows("3:3").Select
Selection.Insert Shift:=xlDown
Range("B2").Select
Application.CutCopyMode = False
Selection.Cut
Range("A3").Select
ActiveSheet.Paste
End Sub