0
0

【Python】Excelシートのセルから情報を取得する

Posted at

for i in range(2, maxRow):
 #1行目は項目欄なので2行目から開始、max_rowでデータが存在する分繰り返しiで行の変数を挿入している。
Cell_01 = ws1.cell(i,1)
Cell_02 = ws1.cell(i,2)
Cell_03 = ws1.cell(i,3)
Cell_04 = ws1.cell(i,4)
Cell_05 = ws1.cell(i,5)

Cell_01_fill = str(Cell_01.value).zfill(4) #桁を揃える

ws2[“b1”] = Cell_01_fill
ws2[“c5”] = Cell_02.value
ws2[“c6”] = Cell_03.value
ws2[“f3”] = Cell_04.value
ws2[“f4”] = Cell_04.value
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0