After studying for a while in private, I left it for a while, but since I installed DataNitro, I've been playing with python for the first time in a while. Since it is DataNitro, implement a function to read data from (excel) sheet.
def get_sheet_data(shtnam, toprow, keyclm, lftclm, rgtclm):
row = toprow
while Cell(shtnam, row, keyclm).value != None:
row += 1
if row > toprow:
return CellRange(shtnam, (toprow, lftclm), (row - 1, rgtclm))
else:
return []
The place to check until the cell of the column that becomes the key item is empty is vba,
Range(sheets(shtnam).Cells(toprow, keyclm), _
sheets(shtnam).Cells(toprow, keyclm)).Select
Selection.End(xlDown).Select
As you can see in the implementation that references `` `Selection.row```, but with DataNitro There seems to be no other way but to look at each cell one by one. Also, there seems to be no way to access the controls such as the buttons on the seat.
I haven't used python very much, but I found it confusing when I looked up classes. I'll write about this in another article.
Recommended Posts