Hi
I have problem with my macro. I want to copy and paste a range of cells from one sheet to another. Excels shows fail in line with Worksheets("Data").Range("B14:B" & Lr).Select everytime.
Sub ApprovalListMatrixDone()
'Kopiowanie zakresów między arkuszami
Dim Lr As Long
Dim Lr1 As Long
With Worksheets("Data")
Lr = Cells(Rows.Count, "B").End(xlUp).Row
Lr1 = Cells(Rows.Count, "J").End(xlUp).Row
End With
Worksheets("Data").Range("B14:B" & Lr).Select
Selection.Copy
Worksheets("Report").Range("B1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Worksheets("Data").Range("J14:J" & Lr1).Select
Selection.Copy
Worksheets("Report").Range("B1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub
I have problem with my macro. I want to copy and paste a range of cells from one sheet to another. Excels shows fail in line with Worksheets("Data").Range("B14:B" & Lr).Select everytime.
Sub ApprovalListMatrixDone()
'Kopiowanie zakresów między arkuszami
Dim Lr As Long
Dim Lr1 As Long
With Worksheets("Data")
Lr = Cells(Rows.Count, "B").End(xlUp).Row
Lr1 = Cells(Rows.Count, "J").End(xlUp).Row
End With
Worksheets("Data").Range("B14:B" & Lr).Select
Selection.Copy
Worksheets("Report").Range("B1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Worksheets("Data").Range("J14:J" & Lr1).Select
Selection.Copy
Worksheets("Report").Range("B1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub