View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
joel[_509_] joel[_509_] is offline
external usenet poster
 
Posts: 1
Default Copy Dynamic Range problem


You posting wasn't clear and most people want it the way I did it. I
also understand why you want it the other way. sorry!

Try these changes


From

LastRow = .Range("E" & Rows.Count).End(xlUp).Row
FirstRow = LastRow - 4

If LastRow <= c.Row Then
MsgBox ("There are no rows to copy on sheet : " & Sht.Name)
Else

If FirstRow <= c.Row Then
FirstRow = c.Row + 1
End If

To

EndRow = .Range("E" & Rows.Count).End(xlUp).Row

If EndRow <= c.Row Then
MsgBox ("There are no rows to copy on sheet : " & Sht.Name)
Else
FirstRow = c.row + 1
LastRow = FirstRow + 4

If LastRow EndRow Then
LastRow = Endrow
End If


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=168586

Microsoft Office Help