ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Please help to copy in a range (https://www.excelbanter.com/excel-discussion-misc-queries/206575-please-help-copy-range.html)

pol

Please help to copy in a range
 

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)

Mike H

Please help to copy in a range
 
Hi,

You must copy the range before filling. Try this

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

Mike

"pol" wrote:


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)


pol

Please help to copy in a range
 
thanks a lot


"pol" wrote:


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)


nastech

Please help to copy in a range
 


"Mike H" wrote:

Hi,

You must copy the range before filling. Try this

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

Mike

"pol" wrote:


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)



All times are GMT +1. The time now is 09:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com