Created
April 30, 2021 11:49
-
-
Save DDSNA/2c49c313ee6985fd02806cd8af5633ca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import openpyxl as xl | |
from openpyxl.chart import BarChart, reference | |
def process_workbook(filename): | |
wb = xl.load_workbook(filename) | |
sheet = wb["Sheet1"] | |
for row in range (2, sheet.max_row +1): | |
cell=sheet.cell(row, 3) | |
corrected_price = cell.value*0.9 | |
corrected_price_cell = sheet.cell(row, 4) | |
corrected_price_cell.value = corrected_price | |
wb.save('edited_excel_file_automated.xlsx') | |
process_workbook('transactions.xlsx') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment