AtBS 12 Excel Flashcards

1
Q

How to import openpyxl?

A

import openpyxl

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How to load a workbook object in openpyxl?

A

WkbkObject = openpyxl.load_workbook (‘wkbk.xlsx’)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How to get Excel tab names with openpyxl?

A

WkbkObject.sheetnames

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How to set a sheet object in openpyxl?

A

sheetname = WkbkObject[‘Sheet1’]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How to get a cell value with openpyxl?

A
  1. Set Variable=Sheet[‘A1’]

2. type Variable.value into shell

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How to convert column letters in Excel

A
  1. From openpyxl.utils import get_column_letter, column_index_from_string
  2. get_column_letter(1) returns A or
  3. Column_index_from_string(‘A’) returns 1
How well did you know this?
1
Not at all
2
3
4
5
Perfectly