paste code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This code has worked good for me in the past:

Dim rng As Range
Set rng = ActiveSheet.AutoFilter.Range
rng.Copy Destination:=Worksheets("Stepdown").Range("A1")

However, it doesn't copy the formulas in the range to the destination as
formulas but converst them to text. How can I modify my code so that it
copies all the formulas, too?
 
You could paste the formulas in a separate step:

Dim ws As Worksheet
Set ws = Worksheets("Stepdown")
Dim rng As Range
Set rng = ActiveSheet.AutoFilter.Range
rng.Copy Destination:=ws.Range("A1")
rng.Copy
ws.Activate
ws.Range("A1").PasteSpecial Paste:=xlPasteFormulas
 
Back
Top