Python Forum
Copy certain cells into new workbook certain cells
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Copy certain cells into new workbook certain cells
#5
How would I go about making ws2 increment by one cell every time it loops to the next file? The cell data for ws1 can remain the same because it's always the same cell data for each file. But ws2 is the template, and I need the cell that the data gets pasted into to increment each time the for loop grabs the next file.

ws2['A2']=ws1['A1].value
would work if I wasn't looping through files, and only had one file to copy and paste from. On the next file I would need it to be
ws2['A3']=ws1[A1'].value
so ws2 incremented by one.
Reply


Messages In This Thread
RE: Copy certain cells into new workbook certain cells - by Kristenl2784 - Jul-14-2020, 07:59 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Why is the copy method name in python list copy and not `__copy__`? YouHoGeon 2 420 Apr-04-2024, 01:18 AM
Last Post: YouHoGeon
  How to copy work sheet data one workbook to other? sayyedkamran 2 825 Nov-03-2023, 09:10 AM
Last Post: Larz60+
  xlwings error when reading a workbook Mishal0488 1 1,274 Aug-01-2023, 02:05 AM
Last Post: deanhystad
  getting unexpected indent errors trying to move cells up jensengt 4 1,015 Jun-28-2023, 12:05 PM
Last Post: deanhystad
  Help in opening and editing an excel workbook from a web-browser test 4 1,600 Aug-10-2022, 02:31 PM
Last Post: test
  Converting cells in excel to JSON format desmondtay 4 1,883 May-23-2022, 10:31 AM
Last Post: Larz60+
  Openpyxl-change value of cells in column based on value that currently occupies cells phillipaj1391 5 10,353 Mar-30-2022, 11:05 PM
Last Post: Pedroski55
  gspread - applying ValueRenderOption to a range of cells dwassner 0 1,793 Jan-12-2022, 03:05 PM
Last Post: dwassner
  Python “Formula” Package: How do I parse Excel formula with a range of cells? JaneTan 1 2,832 Jul-12-2021, 11:09 AM
Last Post: jefsummers
  Add a new column when I extract each sheet in an Excel workbook as a new csv file shantanu97 0 2,317 Mar-24-2021, 04:56 AM
Last Post: shantanu97

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020