Help with the worlds most basic copy & paste loop
Posted: Mon Mar 20, 2017 10:45 pm
Hi world,
I am well and truly new to the wonderful world of OpenOffice Macros and I require some level 1 advice.
I am very simply trying to do this: Copy Cell A2, Paste into B2, Copy results in C2 (Which contains a formula based on B2 as one of the inputs), Paste in D2 as Value.. then loop 5 times.
If I was in VBA it would look like:
Dim n As Integer
For n = 2 to 5
Range("A" & n).Select
Selection.Copy
Range("B" & n).Select
ActiveSheet.Paste
Range("C" & n).Select
Selection.Copy
Range("D" & n).Select
Selection.PasteSepcial Paste:=xlPasteValues
Next n
Can anyone please help translate this into the simplest of terms? Once again I apologies for being such a novice, I am very new to this but understand the time savings this could make!
I have tried a few times but I am not sure ("Column" & n) works in openoffice? And I've read that you shouldn't have an "args" within a loop, which begs the question how does one do it in this circumstance!
Thank you again,
Jack J
I am well and truly new to the wonderful world of OpenOffice Macros and I require some level 1 advice.
I am very simply trying to do this: Copy Cell A2, Paste into B2, Copy results in C2 (Which contains a formula based on B2 as one of the inputs), Paste in D2 as Value.. then loop 5 times.
If I was in VBA it would look like:
Dim n As Integer
For n = 2 to 5
Range("A" & n).Select
Selection.Copy
Range("B" & n).Select
ActiveSheet.Paste
Range("C" & n).Select
Selection.Copy
Range("D" & n).Select
Selection.PasteSepcial Paste:=xlPasteValues
Next n
Can anyone please help translate this into the simplest of terms? Once again I apologies for being such a novice, I am very new to this but understand the time savings this could make!
I have tried a few times but I am not sure ("Column" & n) works in openoffice? And I've read that you shouldn't have an "args" within a loop, which begs the question how does one do it in this circumstance!
Thank you again,
Jack J