BenjaminDubai
New Member
- Joined
- May 7, 2007
- Messages
- 42
I want to run this maco (pasting formulas into cells, then copying and pasting the values)
Range("N3").Select
ActiveCell.FormulaR1C1 = "=AND(RC[-10]=R3C1,RC[-1]=TRUE)"
Range("N3").Select
Selection.AutoFill Destination:=Range("N3:N1119")
Range("O3").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-1]=TRUE,1/R2C13,"""")"
Range("O3").Select
Selection.AutoFill Destination:=Range("O3:O1137")
Range("O3:O1137").Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
True, Transpose:=False
I next want to then use the same macro again but in this top third I want to paste base my calculations on the next cell down
Range("N3").Select
ActiveCell.FormulaR1C1 = "=AND(RC[-10]=R3C2,RC[-1]=TRUE)"
Range("N3").Select
Selection.AutoFill Destination:=Range("N3:N1119")
Range("O3").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-1]=TRUE,1/R2C13,"""")"
Range("O3").Select
Selection.AutoFill Destination:=Range("O3:O1137")
Range("O3:O1137").Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
True, Transpose:=False
the rest is exactly the same. Now the only way I can do it is re-copy and re-paste the marco 115 times.
Can I run a loop that puts an x in instead of the number that I want fo change and runs it from 1 - 115 ???
Range("N3").Select
ActiveCell.FormulaR1C1 = "=AND(RC[-10]=R3C1,RC[-1]=TRUE)"
Range("N3").Select
Selection.AutoFill Destination:=Range("N3:N1119")
Range("O3").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-1]=TRUE,1/R2C13,"""")"
Range("O3").Select
Selection.AutoFill Destination:=Range("O3:O1137")
Range("O3:O1137").Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
True, Transpose:=False
I next want to then use the same macro again but in this top third I want to paste base my calculations on the next cell down
Range("N3").Select
ActiveCell.FormulaR1C1 = "=AND(RC[-10]=R3C2,RC[-1]=TRUE)"
Range("N3").Select
Selection.AutoFill Destination:=Range("N3:N1119")
Range("O3").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-1]=TRUE,1/R2C13,"""")"
Range("O3").Select
Selection.AutoFill Destination:=Range("O3:O1137")
Range("O3:O1137").Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
True, Transpose:=False
the rest is exactly the same. Now the only way I can do it is re-copy and re-paste the marco 115 times.
Can I run a loop that puts an x in instead of the number that I want fo change and runs it from 1 - 115 ???