Hy guys, I want to copy the content from 2 Excel files in another.
Until now I have this code(I know it`s not complete):
But I checked with debugger and LR recive 1.
I can`t understand why, because I have 26 lines there and I used that line to find the last row for few times and was working.
Anybody can help be?
Thanks!
Until now I have this code(I know it`s not complete):
Code:
Private Sub CommandButton1_Click()
Dim ThisPath As String
ThisPath = ActiveWorkbook.Path
Workbooks.Open Filename:=ThisPath & "\" & "DatabaseLealde1"
b1 = ActiveWorkbook.Name
'Workbooks.Open Filename:=ThisPath & "\" & "DatabaseLealde2"
'b2 = ActiveWorkbook.Name
Workbooks(b1).Sheets("Faza1").Activate
LR = Range("J" & Rows.Count).End(xlUp).Row
Range("A2", "M" & LR).Copy
Workbooks("Grafice").Activate
ActiveWorkbook.Sheets("Faza1").Activate
Range("A2:M2").PasteSpecial Paste:=xlPasteValues
Workbooks(b1).Close SaveChanges:=False
End Sub
But I checked with debugger and LR recive 1.
I can`t understand why, because I have 26 lines there and I used that line to find the last row for few times and was working.
Anybody can help be?
Thanks!