Copy a complete row

  • Thread starter Thread starter Fred Smith
  • Start date Start date
F

Fred Smith

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
 
you can five this a try, but i would qualify the ranges with the sheet names

cell.EntireRow.Copy
Range("A" & lastrow).PasteSpecial xlPasteAll
 
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
 
Thanks Gary. Just what I needed.

Fred.

Gary Keramidas said:
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
 
Back
Top