View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Michael M Michael M is offline
external usenet poster
 
Posts: 118
Default Copy and Paste data

Hi Mike
Finally got time to apply the code, but unfortunately it didn't work.
Sheet1 ends up Blank except for row 17 which has 4 cells of data which have
no connection with sheet 2 whatsoever.
I will try and "understand" the code a little better to see what it is
doing, but any help would be appreciated.

Regards
Michael M

"Mike Fogleman" wrote:

Sub ClearCopy()
Dim srcrng As Range, destrng As Range
Dim lrow As Long

lrow = Sheet2.Cells(Rows.Count, "A").End(xlUp).Row
Set srcrng = Sheet2.Range("A6:F" & lrow)
lrow = Sheet1.Cells(Rows.Count, "B").End(xlUp).Row
Set destrng = Sheet1.Range("B12:G" & lrow)
destrng.Clear
srcrng.Copy Sheet1.Range("B12")
End Sub

Mike F
"Michael M" wrote in message
...
Hi All
I am trying to write a Macro that will allow me to copy all data in Sheet
2,
in the range A6:F6 down to the last line of data, which changes in length
each day.
I then want to clear all cells in range B12:G12 down to the last row,
which
changes each day, on Sheet1 and paste the data from Sheet2.
Any help suggestions would be greatly appreciated.
Thanks in Advance
Michael M