Search

Export data from one workbook to another


Export data from one workbook to another.
Copy data from one workbook to another work.

Sample code below
how to use this code: Check out our Youtube video

Option Explicit

Sub exportData()

'-----------------------------
'Thanks for downloading the code. 
'Please visit our channel for a quick explainer on this code.
'Feel free to update the code as per your need and also share with your friends.
'Channel: Youtube.com/vbaa2z
'Download free codes from http://vbaa2z.blogspot.com
'Autor: L Pamai (vbaa2z.team@gmail.com)
'-----------------------------

    Dim lr As Long
    
    Workbooks.Open Filename:="D:\tempHelp\destination.xlsx"
    
    Workbooks("source.xlsm").Activate
    Sheets("Data").Select
    lr = Range("A" & Rows.Count).End(xlUp).Row
    
    Range("A1:N" & lr).Copy
    
    Workbooks("destination.xlsx").Activate
    
    Sheets("FinalData").Select
    Range("A1").PasteSpecial Paste:=xlPasteValuesAndNumberFormats
    Application.CutCopyMode = False 'esp
    
End Sub

1 comment:

  1. This is awesome and thank you for sharing also, could you please make a video about copy multiple cells with different locations on a sheet to another sheet within the same workbook and update this second sheet and soon as you clear the contents on the first sheet? Thanks.

    ReplyDelete

Note: only a member of this blog may post a comment.