Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copy and past formulas in Excel 1

Status
Not open for further replies.

daseffects

Technical User
Aug 21, 2003
38
GB
Looking for a more efficient way to copy the formula in I2 on sheet1 and insert into c2:f2 & l2.

Using the recorder I came up w/ the below - but running it shows cells being selected and leave L2 selected.

I've tried modifying it by taking out the select method but get errors when I then use the paste method.


Sub lookup()
'
Range("I2").Select
Selection.Copy
Range("C2").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.AutoFill Destination:=Range("C2:F2"), Type:=xlFillDefault
Range("C2:F2").Select
Range("I2").Select
Selection.Copy
Range("L2").Select
ActiveSheet.Paste
End Sub
 
range("i2").copy
range("c2:f2,l2").pastespecial xlpasteall

this should do it.


Thanks Rob.[yoda]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top