Rolly_Sefu
Board Regular
- Joined
- Oct 25, 2013
- Messages
- 149
Hello, I have created a code that allows me to copy info from a cell into a workbook that will be opened and then closed.
But now I want to change to code to copy from one open workbook to another open workbook, and I need help.
this is my code
Thanks you.
But now I want to change to code to copy from one open workbook to another open workbook, and I need help.
this is my code
Code:
Sub Macro10()
txt = ActiveWindow.Caption
Range("G1") = Range("D6")
Range("H1") = "=VALUE(R[7]C[-4])"
Range("H1") = Range("H1")
If Range("D36") = "training " Then
Range("I1") = Range("C36")
Range("J1") = Range("C27")
Else
Range("I1") = 0
Range("J1") = 0
End If
'Range("G1:J1").Copy
Set x = Workbooks.Open("C:\Users\jagerr\Desktop\output2.xlsx")
Dim LastRow As Long
LastRow = Workbooks("output2.xlsx").Worksheets("Info").Range("A" & Rows.Count).End(xlUp).Row + 1
Workbooks("output2.xlsx").Worksheets("info").Range("A" & LastRow & ":" & "D" & LastRow).Value = Workbooks(txt).Worksheets("output").Range("G1:J1").Value
Application.DisplayAlerts = False
x.Close SaveChanges:=True
Application.DisplayAlerts = True
End Sub
Thanks you.