5
我有一個工作簿,我想使用OpenPyXI清除一系列值。到目前爲止,我有以下幾點:如何使用OpenPyXl清除Excel工作簿中的值範圍
# import OpenPyXl module
from openpyxl import load_workbook
# load workbook
wb = load_workbook(filename = 'testing.xlsx')
# make variable with worksheet you want to view/modify
sheet = wb['AR Cutoff']
# Change value of A3
sheet['A3'] = 'Assigned value'
總之,我想在OpenPyXL做以下VBA做同樣的事情:
Worksheets("Sheet1").Range("A1:G37").Clear
謝謝!
這很好用,謝謝! – Andrew