Forum Discussion

ChrisCarpenter's avatar
ChrisCarpenter
Copper Contributor
Jan 16, 2024
Solved

Python in Excel iteration of sheets

Hello and thank you for any assistance.   I have 1 in A1 and 2 in A2 of Sheet2 Additionally, I have the same setup in Sheet3.     for i in range(2,4): value = f"Sheet{i}!A1:A2" print(x...
  • SergeiBaklan's avatar
    SergeiBaklan
    Jan 18, 2024

    ChrisCarpenter 

    Python in Excel doesn't work with such kind of indirect references, i.e.

    a = "Sheet2!A1:A2"
    xl(a)

    returns the same error. xl() accepts direct names of the Excel objects.

Resources