How To Reference a Single Cell Using xlwings?

Method

#xlwings

sht.range(‘A1’).select()

#sht.range(1,1).select()

#sht[‘A1’].select()

#sht.cells(1,1).select()

#sht.cells(1,’A’).select()

 

#xlwings API

#sht.api.Range(‘A1’).Select()

#sht.api.Cells(1, ‘A’).Select()

#sht.api.Cells(1,1).Select()

Sample Code

#Referencing a Single Cell

import xlwings as xw    #Import the xlwings package

bk=xw.Book()
sht=bk.sheets.active    #Get the active worksheet

#xlwings
sht.range('C3').select()
#sht.range(3,3).select()
#sht['C3'].select()
#sht.cells(3,3).select()
#sht.cells(3,'C').select()

#xlwings API
#sht.api.Range('C3').Select()
#sht.api.Cells(3, 'C').Select()
#sht.api.Cells(3,3).Select()

#bk.close()
#app.kill()
Reference a Single Cell Using xlwings
January 25, 2026 (0)


Leave a Reply

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