Copy a complete row

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
 
G

Gary Keramidas

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

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

Patrick Molloy

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
 
F

Fred Smith

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
 

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