Automatic cut and paste based on dynamic ranges

  • Thread starter Thread starter DangerMouse
  • Start date Start date
D

DangerMouse

Hi all,

I wish to update one worksheet (containing an XML export 'list') with
values from various distilled other worksheets.

Its quite a simple operation, on click of a macro button take all
'completed' rows from one work sheet and append onto the bottom of the
'master list' contained in another file.

Im guessing this involves dynamic rangest to automate, but from there
I'm a little stuck.

Any help will be fantastic.

Steve
 
One way:

Dim rDest As Range
Dim rSource As Range

With Sheets("Source")
Set rSource = .Cells(1, 1).Resize( _
.Cells(.Rows.Count, 1).End(xlUp).Row, 1)
End With
With Workbooks("MasterBook.xls").Sheets("MasterList")
If IsEmpty(.Cells(1, 1).Value) Then
Set rDest = .Cells(1, 1)
Else
Set rDest = .Cells(.Rows.Count, 1).End(xlUp).Offset(1, 0)
End If
End With
rSource.EntireRow.Copy Destination:=rDest
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top