Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro does not populate later rows
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro does not populate later rows
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" wrote: 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro does not populate later rows
Tom:
That worked great - thanks for the help.l Amy "Tom Ogilvy" wrote: 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" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to populate data (repeating rows) | Excel Discussion (Misc queries) | |||
Populate Data In Rows | Excel Discussion (Misc queries) | |||
Populate Rows from worksheet Names. | Excel Discussion (Misc queries) | |||
Macro to add rows and populate cells | Excel Programming | |||
Macro to add rows and populate cells based on critera | Excel Programming |