Link to home
Start Free TrialLog in
Avatar of Justin
Justin

asked on

Macro to copy formulas to the column direcly to the right and maintain the same range.

Hi Guys, I am having a problem with this Macro which needs tweaking. It copies a column of Formulas and pastes them to the Column directly to the right. The problem is it does not keep the same range, eg, the formula =SUM(AA6:AW6") becomes =sum("AB6:AW6"). How do I maintain the same range? Here's the code. Please see attachment

Sheets("Detailed Summary").Select

Range("M6").Select
    Selection.End(xlToRight).Select
    ActiveCell.Columns("A:B").EntireColumn.Select
    ActiveCell.Activate
    Selection.FillRight
    ActiveCell.Columns("A:A").EntireColumn.Select
    ActiveCell.Activate
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Application.CutCopyMode = False
Detailed-Summary.xlsm
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Justin
Justin

ASKER

superb