xlwings: Referencing Entire Row

xlwings code:

#Referencing an Entire Row

import xlwings as xw    #Import the xlwings package

app=xw.App()
bk=app.books.active    #Get the active workbook
sht=bk.sheets.active    #Get the active worksheet

#Single Row
#xlwings
sht.range('1:1').select()     #Row 1
#sht['1:1'].select()

#xlwings API
#sht.api.Rows(1).Select()
#sht.api.Range('1:1').Select()
#sht.api.Range('A1').EntireRow.Select()

#Multiple Rows
#xlwings
#sht.range('1:5').select()    #Rows 1–5
#sht['1:5'].select()
#sht[0:5,:].select()

#xlwings API
#sht.api.Rows('1:5').Select()
#sht.api.Range('1:5').Select()
#sht.api.Range('A1:C5').EntireRow.Select()

#bk.close()
#app.kill()


category : xlwings: Object Model

Leave a Reply

Your email address will not be published. Required fields are marked *

Zoomed Image