PAsting a selection, but only if complete row is empty
Posted by Remi on February 05, 2002 7:58 AM
Hi,
I made a macro which gets information from somewhere and now I want this information to be pasted in a "summary" file. This file gets bigger and bigger so the pasting must take place at the first row that is free.
I am using this piece of programme to do this now:
(to search for the first free row and paste the copied info there)
Sub scanpast()
Dim r As Long
Range("A1").Activate
For r = 1 To 65536
If Not IsEmpty(ActiveCell) Then
ActiveCell.Offset(1, 0).Activate
Else
If IsEmpty(ActiveCell) And IsEmpty(ActiveCell.Offset(0, 1)) And _
IsEmpty(ActiveCell.Offset(0, 2)) And IsEmpty(ActiveCell.Offset(0, 3)) And _
IsEmpty(ActiveCell.Offset(0, 4)) And IsEmpty(ActiveCell.Offset(0, 5)) And _
IsEmpty(ActiveCell.Offset(0, 6)) And IsEmpty(ActiveCell.Offset(0, 7)) And _
IsEmpty(ActiveCell.Offset(0, 8)) And IsEmpty(ActiveCell.Offset(0, 9)) _
Then
ActiveSheet.Paste
ActiveWorkbook.Save
Exit For
Else
ActiveCell.Offset(1, 0).Activate
End If
End If
I got it from somewere and to be honest, I CAN`T FIGURE OUT HOW IT WORKS! Can anybody explain the above mentioned piece of programme to me?
Thanks a lot.
Remi.
Holland.