Please help to copy in a range

P

pol

I given the following command to copy in a range upto end of the column of
that cell in a macro. the error message is 'Autofill mathod range class
failed ' given by the system
But it is not working . Please help me with correct command

Selection.AutoFill Destination:=Range("O2:O" & Cells(Rows.Count,
"O").End(xlUp).Row)
 
M

Mike H

Hi,

You must copy the range before filling. Try this

Selection.Copy Destination:=Range("O2:O" & Cells(Rows.Count,
"O").End(xlUp).Row)

Mike
 

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