Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- https://excel-egy.com/forum/t4043
- ---------------------------------
- Sub Copy_Data_As_Values_From_Closed_Workbook()
- Dim wb As Workbook, ws As Worksheet, sh As Worksheet, m As Long, n As Long, x As Long
- Application.ScreenUpdating = False
- Set wb = Workbooks.Open(ThisWorkbook.Path & "\boys.xlsx")
- Set ws = wb.Worksheets("Export 2")
- Set sh = ThisWorkbook.Worksheets("All Data")
- m = ws.Cells(Rows.Count, 1).End(xlUp).Row
- n = sh.Cells(Rows.Count, 1).End(xlUp).Row + 1
- x = ws.Range("B7:B" & m).Rows.Count
- sh.Range("A" & n).Resize(x, 3).Value = ws.Range("B7").Resize(x, 3).Value
- sh.Range("K" & n).Resize(x, 6).Value = ws.Range("E7").Resize(x, 6).Value
- wb.Close False
- Application.ScreenUpdating = True
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement