Cakz Primz
Board Regular
- Joined
- Dec 4, 2016
- Messages
- 102
- Office Version
- 365
- Platform
- Windows
Dear All,
I need your help. I want to copy the entire row from "AXREP" sheet in "AXREP" workbook into my active sheet, "AXREP" in "MY AXREP" workbook.
So far, the code below is working, but the problem I don't know the code to copy until the last row from another workbook. I want selected range to copied is dynamic.
Right now, the selected range is not dynamic, see the bold line.
I hope that someone would like to help me.
Thanks so much in advance.
Prima-Indonesia
I need your help. I want to copy the entire row from "AXREP" sheet in "AXREP" workbook into my active sheet, "AXREP" in "MY AXREP" workbook.
So far, the code below is working, but the problem I don't know the code to copy until the last row from another workbook. I want selected range to copied is dynamic.
Right now, the selected range is not dynamic, see the bold line.
VBA Code:
Windows("AXREP.xlsb").Activate
[B][I]Workbooks("AXREP.xlsb").Worksheets("AXREP").Range("A2:CC150000").Copy[/I][/B]
Workbooks("MY AXREP.xlsb").Worksheets("AXREP").Range("A3").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
VBA Code:
Sub OpenCopyPaste()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim ws As Worksheet
Set ws = ActiveSheet
Dim lRow As Long
lRow = Cells(Rows.Count, 1).End(xlUp).Row
With ws
.Range("A3:CC" & lRow).ClearContents
End With
Call GetLatestAXREP 'Open latest file of AXREP.xlsb
Windows("AXREP.xlsb").Activate
[B][I]Workbooks("AXREP.xlsb").Worksheets("AXREP").Range("A2:CC150000").Copy[/I][/B]
Workbooks("MY AXREP.xlsb").Worksheets("AXREP").Range("A3").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub
I hope that someone would like to help me.
Thanks so much in advance.
Prima-Indonesia