I know there are about a thousand of these floating around on here but I cannot seem to find one that helps. Here is what I have so far
Sub Book1()
Application.ScreenUpdating = False
Dim Masterbook As Workbook
Dim Mybook As String
Dim Pathname As String
Dim i As Integer
Application.DisplayAlerts = False
Set Masterbook = ActiveWorkbook
For i = 1 To 2
Mybook = Range("M" & i).Text
Pathname = "C:\Documents and Settings\leaxl49\Desktop"
Workbooks.Open Filename:=Pathname & Mybook
If i = 1 Then
ActiveWorkbook.ActiveSheet.Range("B4:BB4").Copy Destination:=Masterbook.ActiveSheet.Range("B4:BB4")
ActiveWorkbook.Close
Else
ActiveWorkbook.ActiveSheet.Range("B4:BB4").Copy Destination:=Masterbook.ActiveSheet.Range("F4:G")
ActiveWorkbook.Close
End If
Next i
Application.DisplayAlerts = True
End Sub
This is the error that I get when I try to run it
Run-time error '1004':
Application-defined or object defined error
I am trying to pull data from "Copy Recap" B4:B44 and put it in "Book 1" B4:B44 of the other workbook. I have no idea if the names are right in that code or not, it is just something that I found on here from February of last year.
thanks for the help
Bookmarks