Forum Discussion

rockyb855's avatar
rockyb855
Copper Contributor
Jul 28, 2025

Issues with basic excel python

Hello,

 

I am trying to get values from the C column in the worksheet A2025.

I am not even sure the xl("A2025") is getting anything.

when i just do df_2025 = xl("A2025", headers=False) I get back none.

 

any help would be appreciated.

 

thanks

 

 

 

4 Replies

  • JKPieterse's avatar
    JKPieterse
    Silver Contributor

    The correct syntax to get data from column C of that worksheet is:

    df_2025 = xl("'A2025'!C.:.C", headers=False)

    Note the .:. (instead of the usual : ) it tells Excel that you only want the area which contains data.

    • rockyb855's avatar
      rockyb855
      Copper Contributor

      Thanks.

      one more item. 

      How can you print the values in a column in Excel?

      The dataframe will only produce a snipit of the dataframe.

      Is there a way to actually have the df data print in a specific column of excel?

       

       

       

       

    • rockyb855's avatar
      rockyb855
      Copper Contributor

      Thanks, if I may ask a followup.

      Once you get a dataframe with your final data,

      How can I write it out in an excel column.  In the below I get the snipit of data.

      How could I print the values in the G column. one value per row.

      thanks

       

       

Resources