Both workbooks need to be open for this to work. And it finds the next
available row by starting at the bottom of column F and going to the top (then
down one):
Option Explicit
Sub testme()
Dim fWks As Worksheet
Dim tWks As Worksheet
Dim DestCell As Range
Set fWks = Workbooks("book1.xls").Worksheets("sheet1")
Set tWks = Workbooks("book2.xls").Worksheets("sheet1")
With fWks
If IsEmpty(.Range("b4")) _
Or IsEmpty(.Range("d4")) Then
MsgBox "please put something in both B4 and D4"
Exit Sub
End If
With tWks
Set DestCell = .Cells(.Rows.Count, "F").End(xlUp).Offset(1, 0)
End With
DestCell.Value = .Range("b4").Value
DestCell.Offset(0, 1).Value = .Range("d4").Value
End With
End Sub
Jenno wrote:
Hi
Hope someone can help. I need a macro to enable moving two individual
cells from one workbook to another workbook. In the first sheet
*(Daily)* the cells will always be entered on the same row. A summary
will be kept each time the row has different data written to it (every
day) on a second sheet *(Summary), * so they need to be positioned there
sequentially.
eg cells b4 and d4 in workbook Daily need a macro to be moved to the
Summary workbook - first time to cells f2 and g2 - then next time to
row beneath and so on each time macro is run. Hope this makes sense!
Thanks Jenno
--
Jenno
------------------------------------------------------------------------
Jenno's Profile: http://www.excelforum.com/member.php...o&userid=26236
View this thread: http://www.excelforum.com/showthread...hreadid=397691
--
Dave Peterson