Method
#xlwings
sht[‘A2, B3:C8, E2:F5’].select() #Reference multiple cell ranges
#sht.range(‘A2, B3:C8, E2:F5’).select()
#xlwings API
#sht.api.Range(‘A2, B3:C8, E2:F5’).Select()
Sample Code
#Reference multiple cell ranges at once
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
#xlwings
sht['A2, B3:C8, E2:F5'].select() #Reference multiple cell ranges
#sht.range('A2, B3:C8, E2:F5').select()
#xlwings API
#sht.api.Range('A2, B3:C8, E2:F5').Select()
#bk.close()
#app.kill()

Leave a Reply