View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default In Excel 2000, how can a macro look for the next empty cell?

One way:

Dim vBooks As Variant
Dim rDest As Range
Dim i As Long

vBooks = Array("Book1.xls","Book2.xls","Book3.xls")

For i = LBound(vBooks) To UBound(vBooks)
Set rDest = Workbooks("DestBook.xls").Sheets(1).Range( _
"A" & Rows.Count).End(xlUp).Offset(1, 0)
Workbooks(vBooks(i)).Sheets(1).Range("A1:J10").Cop y _
Destination:=rDest
Next i



In article ,
"Martin Hextall" wrote:

I have written a macro to get data from several spreadsheets and paste it
into another. Because the size of the data is variable, I am having to leave
spaces between sections of data to ensure that it doesn't overwrite anything.
Is there a way that the macro can look for the next empty row rather than me
leaving gaps?