Macro does not populate later rows

G

Guest

I have create a macro and when I go to the next cell and try to run the
Macro, it puts data in the first cell, but then goes to me original line of
data - it does not populate the rest of the 2nd row.

When I look at the macro, it seems to reference a specific cell. I need some
help.

Thanks,

Here is the macro:

ActiveCell.FormulaR1C1 = "=MID(RC[-2],3,14)"
Range("D3").Select
ActiveCell.FormulaR1C1 = "=MID(RC[-3],17,12)"
Range("E3").Select
ActiveCell.FormulaR1C1 = "=MID(RC[-4],29,10)"
Range("F3").Select
ActiveCell.FormulaR1C1 = "=MID(RC[-5],46,6)"
Range("G3").Select
ActiveCell.FormulaR1C1 = "=MID(RC[-6],52,4)"
Range("I3").Select
ActiveCell.FormulaR1C1 = "=RIGHT(RC[-6],5)"
Range("J3").Select
ActiveCell.FormulaR1C1 = "=+RC[-6]"
Range("K3").Select
ActiveCell.FormulaR1C1 = "=RC[-6]*1"
Range("L3").Select
ActiveCell.FormulaR1C1 = "=RC[-6]"
Range("M3").Select
ActiveCell.FormulaR1C1 = _

"=IF(RC[-6]=""1000"",""LA"",IF(RC[-6]=""2000"",""Mex"",IF(RC[-6]=""3000"",""Brz"",IF(RC[-6]=""4000"",""Arg"",IF(RC[-6]=""5000"",""Boom"",IF(RC[-6]=""5600"",""Cartoon LA""))))))"
Range("N3").Select
ActiveCell.FormulaR1C1 = _

"=IF(RC[-1]=""Arg"",(RC[-1]*Rate!R3C2),IF(RC[-1]=""Brz"",(RC[-3]*Rate!R4C2),IF(RC[-1]=""Mex"",(RC[-1]*Rate!R5C2),RC[-3])))"
Range("O3").Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[-2]=""Arg"",
""ARS"",IF(RC[-2]=""Brz"",""BRL"",IF(RC[-2]=""Mex"", ""MXN"",""USD"")))"
Range("C3:O3").Select
Range("O3").Activate
Selection.Copy
End Sub
 
G

Guest

ActiveCell.FormulaR1C1 = "=MID(RC[-2],3,14)"
Range("D3").Select

you explictly tell it to select D3.

Try changing Range("D3").Select and your other specific locations with

activecell.offset(0,1).Select
 
G

Guest

Tom:

That worked great - thanks for the help.l

Amy

Tom Ogilvy said:
ActiveCell.FormulaR1C1 = "=MID(RC[-2],3,14)"
Range("D3").Select

you explictly tell it to select D3.

Try changing Range("D3").Select and your other specific locations with

activecell.offset(0,1).Select

--
Regards,
Tom Ogilvy




Ldyflyr said:
I have create a macro and when I go to the next cell and try to run the
Macro, it puts data in the first cell, but then goes to me original line of
data - it does not populate the rest of the 2nd row.

When I look at the macro, it seems to reference a specific cell. I need some
help.

Thanks,

Here is the macro:

ActiveCell.FormulaR1C1 = "=MID(RC[-2],3,14)"
Range("D3").Select
ActiveCell.FormulaR1C1 = "=MID(RC[-3],17,12)"
Range("E3").Select
ActiveCell.FormulaR1C1 = "=MID(RC[-4],29,10)"
Range("F3").Select
ActiveCell.FormulaR1C1 = "=MID(RC[-5],46,6)"
Range("G3").Select
ActiveCell.FormulaR1C1 = "=MID(RC[-6],52,4)"
Range("I3").Select
ActiveCell.FormulaR1C1 = "=RIGHT(RC[-6],5)"
Range("J3").Select
ActiveCell.FormulaR1C1 = "=+RC[-6]"
Range("K3").Select
ActiveCell.FormulaR1C1 = "=RC[-6]*1"
Range("L3").Select
ActiveCell.FormulaR1C1 = "=RC[-6]"
Range("M3").Select
ActiveCell.FormulaR1C1 = _

"=IF(RC[-6]=""1000"",""LA"",IF(RC[-6]=""2000"",""Mex"",IF(RC[-6]=""3000"",""Brz"",IF(RC[-6]=""4000"",""Arg"",IF(RC[-6]=""5000"",""Boom"",IF(RC[-6]=""5600"",""Cartoon LA""))))))"
Range("N3").Select
ActiveCell.FormulaR1C1 = _

"=IF(RC[-1]=""Arg"",(RC[-1]*Rate!R3C2),IF(RC[-1]=""Brz"",(RC[-3]*Rate!R4C2),IF(RC[-1]=""Mex"",(RC[-1]*Rate!R5C2),RC[-3])))"
Range("O3").Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[-2]=""Arg"",
""ARS"",IF(RC[-2]=""Brz"",""BRL"",IF(RC[-2]=""Mex"", ""MXN"",""USD"")))"
Range("C3:O3").Select
Range("O3").Activate
Selection.Copy
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top