copy formula

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

Guest

I would like to copy the formula of Cell A1 to A2:A10 by using the following
code, but it always shows the "Object required".

Sub copyfor()
With Range("A1").copy
Range("A2:A10").pastespecial = xlformula
End with
End Sub

Could someone show me the right way to do it.

Thanks
 
Alan,

A good tip in solving issues like this is to record yourself doing it with
the macro recorder. Try this:-

Sub stantial()
Range("A1").Select
Selection.AutoFill Destination:=Range("A1:A10")
End Sub

Mike
 
Range("A1").Copy
Range("A2:A10").PasteSpecial Paste:=xlPasteFormulas

Regards

Trevor
 
I would like to copy the formula of Cell A1 to A2:A10 by using the following
code, but it always shows the "Object required".

Sub copyfor()
With Range("A1").copy
Range("A2:A10").pastespecial = xlformula
End with
End Sub

Could someone show me the right way to do it.

Thanks

Alan,

Range("A2:A10").Formula = Range("A1").Formula

Regards

Iztok
 

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

Back
Top