I am using this macro to insert one column and then to paste a formula in each row of the column. It works except that I want to do it for two columns and two different formulas.
There is another problem with this macro. When it paste the formula in the column, it puts single quotation marks on both sides of the cell references in the formula and the formula does not work due to this insertion. Can those single quotation marks be removed before the macro pastes the formula to the cells? If anybody can help me, I would appreciate it.
Thank you,
Jared Z.
Code:
[LEFT][COLOR=#26282A][FONT=Helvetica Neue]Sub Insert_Col_Form ()[/FONT][/COLOR]
[COLOR=#26282A][FONT=Helvetica Neue]'[/FONT][/COLOR]
[COLOR=#26282A][FONT=Helvetica Neue]'[/FONT][/COLOR]
[COLOR=#26282A][FONT=Helvetica Neue]Dim Rng As Range[/FONT][/COLOR]
[COLOR=#26282A][FONT=Helvetica Neue] Columns("F:F").Insert[/FONT][/COLOR]
[COLOR=#26282A][FONT=Helvetica Neue] Set Rng = Range("F2:F" & Range("E2").End(xlDown).Row)[/FONT][/COLOR]
[COLOR=#26282A][FONT=Helvetica Neue] Rng.FormulaR1C1 = "=IF(LEFT(E2,1)=""-"",MID(E2,2,LEN(E2)),E2)"[/FONT][/COLOR]
[COLOR=#26282A][FONT=Helvetica Neue] [/FONT][/COLOR]
[COLOR=#26282A][FONT=Helvetica Neue]End Sub[/FONT][/COLOR][/LEFT][B][I][U][SUB][SUP]<strike>
</strike>[/SUP][/SUB][/U][/I][/B][/FONT][/COLOR][COLOR=#222222][FONT=Verdana]
There is another problem with this macro. When it paste the formula in the column, it puts single quotation marks on both sides of the cell references in the formula and the formula does not work due to this insertion. Can those single quotation marks be removed before the macro pastes the formula to the cells? If anybody can help me, I would appreciate it.
Thank you,
Jared Z.