@ > Home > Contents > Copy (or: clone) formulae identically as "Cut" does Excel 97+

Problem

At cutting and inserting a range, you keep the original formulae. But only once as before! How can you copy them like "Cut"?

Solution (2007/01/20 Thomas Ramel)

a) by interactive in-code selection for source and goal:

Sub Copy_Formula()
    Dim rngSource As Range
    Dim rngGoal As Range
    Set rngSource = Application.InputBox("Please select source to be copied", "Source range", Type:=8)
    Set rngGoal = Application.InputBox("Now select first cell of the goal", "Goal range", Type:=8)
    With rngSource
        rngGoal.Resize(.Rows.Count, .Columns.Count).Formula = .Formula
    End With
End Sub

b) by usage of active selection as source and interactive in-code selection for goal:

Sub Copy_Formula_Selection()
   Dim rngGoal As Range
   Set rngGoal = Application.InputBox("Please select first cell of the goal", "Goal range", Type:=8)
   With Selection
      rngGoal.Resize(.Rows.Count, .Columns.Count).Formula = .Formula
   End With
End Sub