View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Trevor[_3_] Trevor[_3_] is offline
external usenet poster
 
Posts: 3
Default Copying a range to the row below

I want to copy a range of cells in one row to the next empty row.

I do it like this:

Worksheets("Ledger").Activate

i = GetLastRow() ' Get last row number from function (getlastrow)

Set MyRange = Range("A" & i & ":L" & i) ' Set range to last row

MyRange.Copy Destination:=Worksheets _
("Ledger").Range("A" & i + 1 & ":L" & i + 1)

That works fine (though there could be a better way)

However, if I then copy the same range to a different worksheet, where
the cells on the source range are empty, on the pasted range they
show up as O's

Is there a way to avoid this without having to then cycle through all
of the pasted range clearing the cells with 0's ?

Trevor