User Profile

Collapse

Profile Sidebar

Collapse
Fatman003
Fatman003
Last Activity: Aug 29 '19, 08:41 AM
Joined: Aug 20 '19
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Copy data from different workbook into Master sheet using Python

    I have to copy data from different workbooks and paste it into a master workbook. All the workbooks including the Master file are located in a folder: C:\Users\f65651 \data

    So far I have been able to copy data from only one workbook using the code below
    Code:
     
    import openpyxl as xl
    
    path1 ='C:\\Users\\f65651\data\\cq1.xlsx' #One of the doc
    #path3 = 'C:\\Users\\f65651\data\\cq2.xlsx'
    path2='C:\\Users\\f65651\\data\\Results.xlsx'
    ...
    See more | Go to post

  • So far I have done this:

    Code:
    import openpyxl as xl
    
    path1="C:\Users\f6565\Desktop\data\data1.xlsx"
    path2="C:\Users\f6565\Desktop\data\Result.xlsx"
    
    wb1 = xl.load_workbook(filename=path1)
    ws1 = wb1.worksheets[0]
    wbX = xl.load_workbook(filename=path0)
    wsX = wbX.worksheets[0]
    wb2= xl.load_workbook(filename=path2)
    ws2= wb2.worksheets[0]
    ...
    See more | Go to post
    Last edited by gits; Aug 21 '19, 07:31 AM. Reason: please use code tags

    Leave a comment:


  • Thread Modes Python code to copy data from multiple workbooks into master sheet

    I have to copy data from 6 workbooks and paste it into a master workbook. All the workbooks are located in a folder on my desktop: C:\Users\f6565\ Desktop\data

    The workbooks contain a sheet named 'Main Data', I have to open each workbook, go to sheet 'Main Data’, select columns range A to GJ starting from row 5 to row 'x' (end of the rows), then copy and paste the data range into the master worksheet. In the master worksheet (named...
    See more | Go to post
    Last edited by gits; Aug 21 '19, 07:31 AM. Reason: please use code tags
No activity results to display
Show More
Working...