excel convert cell value to range
=INDIRECT("range")
=INDIRECT(cell_with_range_as_text)
excel convert cell value to range
=INDIRECT("range")
=INDIRECT(cell_with_range_as_text)
xlrd cell range
import xlrd
import re
def parse_cell(cell):
r = re.compile("([a-zA-Z]+)([0-9]+)")
m = r.match(cell)
col = m.group(1).upper()
number_row = int(m.group(2)) - 1
ABC = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
number_col = 0
for char in col:
number_col += ABC.index(char)
return (number_row, number_col)
def get_cell_range_values(sheet, start_cell, end_cell):
start_cell_parsed = parse_cell(start_cell)
end_cell_parsed = parse_cell(end_cell)
data = sheet.col_values(start_rowx=start_cell_parsed[0], colx=start_cell_parsed[1], end_rowx=end_cell_parsed[0] + 1)
return data
file = r"C:UsersLisaDesktopFrankexport.XLSX"
book = xlrd.open_workbook(file)
sheet = book.sheet_by_index(0)
data = get_cell_range_values(sheet, "A3", "A130")
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us