replace copy and paste

S

Sliman

I have below macro recorded and would like to replace copy and paste
with = Formula if possible.

Range("D8:H8").Select
Selection.AutoFilter
Selection.AutoFilter

Range("B9:D11").Select
Application.CutCopyMode = False
Selection.Copy
Range("B12:D12").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste


Selection.AutoFilter Field:=5, Criteria1:="<>Prd", Operator:=xlAnd
Range("I10:BZ11").Select
Range("I10:CA11").Select
Selection.Copy

Range("I13:CA13").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste

Selection.AutoFilter Field:=5
Application.CutCopyMode = False

Rows("9:11").Select
Selection.EntireRow.Hidden = True


Thanks with any help
 
I

ITperson

Hi Sliman

Im not sure what you mean, but you could use vba to enter a formula in a cell.

If it is a linking formula then in the vbe you could use something like this.

Range("A5").formula = "='Sheet1!B5'

HTH

Terry
 
I

ITperson

Sorry but there is a syntax error in my last post:

It should be

Range("A5").formula="=Sheet1!B5"
 

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