paste code

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?
 
D

Debra Dalgleish

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top