Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,389
Default Copy a complete row

I have the following code segment:

Set WorkRange = ...
For Each cell in WorkRange
Taxrow = application.match(cell.value, range("A:A"), 0)
if iserror(taxrow) and cell.offset(0,9) < "Inactive" then

Now I want to copy the entire row that "cell" is on to the active worksheet
row "LastRow".

Is there one or two lines of code that would do this?

Thanks,
Fred

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Copy a complete row

you can five this a try, but i would qualify the ranges with the sheet names

cell.EntireRow.Copy
Range("A" & lastrow).PasteSpecial xlPasteAll

--


Gary Keramidas
Excel 2003


"Fred Smith" wrote in message
...
I have the following code segment:

Set WorkRange = ...
For Each cell in WorkRange
Taxrow = application.match(cell.value, range("A:A"), 0)
if iserror(taxrow) and cell.offset(0,9) < "Inactive" then

Now I want to copy the entire row that "cell" is on to the active worksheet
row "LastRow".

Is there one or two lines of code that would do this?

Thanks,
Fred


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Copy a complete row

here's an idea:

target = 3
Source = 11

Rows(target).Value = Rows(Source).Value

or

Rows(target).Formula = Rows(Source).Formula

you will of course lose any formatting from the source row
"Fred Smith" wrote:

I have the following code segment:

Set WorkRange = ...
For Each cell in WorkRange
Taxrow = application.match(cell.value, range("A:A"), 0)
if iserror(taxrow) and cell.offset(0,9) < "Inactive" then

Now I want to copy the entire row that "cell" is on to the active worksheet
row "LastRow".

Is there one or two lines of code that would do this?

Thanks,
Fred


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,389
Default Copy a complete row

Thanks Gary. Just what I needed.

Fred.

"Gary Keramidas" <GKeramidasAtMSN.com wrote in message
...
you can five this a try, but i would qualify the ranges with the sheet
names

cell.EntireRow.Copy
Range("A" & lastrow).PasteSpecial xlPasteAll

--


Gary Keramidas
Excel 2003


"Fred Smith" wrote in message
...
I have the following code segment:

Set WorkRange = ...
For Each cell in WorkRange
Taxrow = application.match(cell.value, range("A:A"), 0)
if iserror(taxrow) and cell.offset(0,9) < "Inactive" then

Now I want to copy the entire row that "cell" is on to the active
worksheet row "LastRow".

Is there one or two lines of code that would do this?

Thanks,
Fred



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Workbook with 40 sheets, want complete copy without formulaes Johannes Excel Discussion (Misc queries) 1 July 29th 09 04:44 AM
copy sheet complete with command buttons and code into other workbook !!! Corey Excel Programming 3 November 23rd 06 03:48 AM
how to copy same percentage to complete worksheet steelbird Excel Worksheet Functions 1 October 8th 06 03:55 PM
Copy complete row Joel Excel Worksheet Functions 1 October 28th 05 01:09 AM
Copy over files/replace (complete question) G3£Wh\)zZ@ New Users to Excel 1 October 10th 05 10:38 AM


All times are GMT +1. The time now is 06:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"