How To Reference the Used Range of a Worksheet Using xlwings?

Method

#xlwings

sht.used_range.select()

 

#xlwings API

#sht.api.UsedRange.Select()

Sample Code

#Reference the used range of a worksheet

import xlwings as xw    #Import the xlwings package

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

#xlwings
sht.used_range.select()

#xlwings API
#sht.api.UsedRange.Select()

#bk.close()
#app.kill()
Reference the Used Range of a Worksheet Using xlwings
February 1, 2026 (0)


Leave a Reply

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