Created
March 16, 2017 00:49
-
-
Save kakakaya/ba6522d5a27703429b16da4a2e29079d to your computer and use it in GitHub Desktop.
Excelシートのセル名をPythonで取得する
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
#!/usr/bin/env python3 | |
# -*- coding:utf-8 -*- | |
# Author: kakakaya, Date: Thu Mar 16 09:35:47 2017 | |
import openpyxl as px | |
def main(): | |
wb = px.load_workbook("sheet_with_cell_name.xlsx") | |
defined_names = wb.defined_names.definedName | |
for defined_name in defined_names: | |
for d in defined_name.destinations: | |
print("Sheet name: {}, location: {}".format(d[0], d[1])) | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment