ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Code help (https://www.excelbanter.com/excel-programming/414474-code-help.html)

Anthony

Code help
 
Hi

I have this bit of code that is part of a macro to search for and copy paste
data when a match is found.


wks1.Cells(iRow, 1).EntireRow.Copy Destination _

I don't want the ENTIRE ROW to be copied just the range A:O
can anybody adapt the code for me please to carry this out

thanks

Don Guillett

Code help
 
wks1.range(Cells(iRow, "a"),cells(irow,"o")).Copy Destination _


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Anthony" wrote in message
...
Hi

I have this bit of code that is part of a macro to search for and copy
paste
data when a match is found.


wks1.Cells(iRow, 1).EntireRow.Copy Destination _

I don't want the ENTIRE ROW to be copied just the range A:O
can anybody adapt the code for me please to carry this out

thanks



Anthony

Code help
 
Thanks Don

"Don Guillett" wrote:

wks1.range(Cells(iRow, "a"),cells(irow,"o")).Copy Destination _


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Anthony" wrote in message
...
Hi

I have this bit of code that is part of a macro to search for and copy
paste
data when a match is found.


wks1.Cells(iRow, 1).EntireRow.Copy Destination _

I don't want the ENTIRE ROW to be copied just the range A:O
can anybody adapt the code for me please to carry this out

thanks




Dave Peterson

Code help
 
wks1.Cells(iRow, 1).resize(1,15).Copy Destination _

Is another way.

Anthony wrote:

Hi

I have this bit of code that is part of a macro to search for and copy paste
data when a match is found.

wks1.Cells(iRow, 1).EntireRow.Copy Destination _

I don't want the ENTIRE ROW to be copied just the range A:O
can anybody adapt the code for me please to carry this out

thanks


--

Dave Peterson

Dave Peterson

Code help
 
Just qualifying the ranges:

wks1.range(wks1.Cells(iRow, "a"),wks1.cells(irow,"o")).Copy Destination _

Don Guillett wrote:

wks1.range(Cells(iRow, "a"),cells(irow,"o")).Copy Destination _

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Anthony" wrote in message
...
Hi

I have this bit of code that is part of a macro to search for and copy
paste
data when a match is found.


wks1.Cells(iRow, 1).EntireRow.Copy Destination _

I don't want the ENTIRE ROW to be copied just the range A:O
can anybody adapt the code for me please to carry this out

thanks


--

Dave Peterson


All times are GMT +1. The time now is 10:18 PM.

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