I tried to merge three macros into one to conserve steps, and it worked at first. I combined this macro with a copy/paste special/value macro and a delete contents of empty cells in a column.
It worked at first. Then I deleted the two columns that were inserted with the formulas pasted in them to start over again. I ran the macro again and it inserted the two columns but only pasted the two formulas in the first two rows. It was empty below these rows. I can not figure out what I did wrong. Can you help me out please?
Thank you,
Jared Z.
Code:
[LEFT][COLOR=#26282A][FONT=Helvetica Neue]Sub MergeColumns()[/FONT][/COLOR]
[COLOR=#26282A][FONT=Helvetica Neue]Columns("F:G").Insert[/FONT][/COLOR]
[COLOR=#26282A][FONT=Helvetica Neue]Range("F2:F" & Range("E2").End(xlDown).Row).Formula = "=IF(LEFT(E2,1)=""-"",MID(E2,2,LEN(E2)),E2)"[/FONT][/COLOR]
[COLOR=#26282A][FONT=Helvetica Neue]Range("G2:G" & Range("F2").End(xlDown).Row).Formula = "=IF(AND(F2>0,S2>0),F2,IF(AND(F2>0,S2=0),F2,IF(AND(F2=0,S2>0),IF(R2>0,CONCATENATE(R2,""-"",S2),S2),0)))"[/FONT][/COLOR]
[COLOR=#26282A][FONT=Helvetica Neue]End Sub[/FONT][/COLOR][/LEFT]
It worked at first. Then I deleted the two columns that were inserted with the formulas pasted in them to start over again. I ran the macro again and it inserted the two columns but only pasted the two formulas in the first two rows. It was empty below these rows. I can not figure out what I did wrong. Can you help me out please?
Thank you,
Jared Z.