Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Excel sheet by color
#1
Hi,

I need to process only that sheet from given excel file whose tab color is YELLOW. Requirement is something like this. My users have an excel file. They highlight the tab in YELLOW color which they modified. So I need to convert only those sheets to csv for further processing. I have code for excel to csv using pandas. But I am not able to identify those sheets only with YELLOW colored. I really appreciate your help here.
I tried using openpyxl, still no luck
ex:
>>> print(ws2.sheet_properties.tabColor)
<openpyxl.styles.colors.Color object>
Parameters:
rgb='FF00B050', indexed=None, auto=None, theme=None, tint=0.0, type='rgb'
Thanks,

ws2.sheet_properties.tabColor.value gave the intended answer
Reply
#2
This gives you the actual rgb code. You can take action based on that.
ws.sheet_properties.tabColor.rgb
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python and pandas: Aggregate lines form Excel sheet Glyxbringer 12 1,697 Oct-31-2023, 10:21 AM
Last Post: Pedroski55
  Turtle Star Fill Color Yellow-White Interchanging Color Effect codelab 9 904 Oct-25-2023, 09:09 AM
Last Post: codelab
  how to read txt file, and write into excel with multiply sheet jacklee26 14 9,525 Jan-21-2023, 06:57 AM
Last Post: jacklee26
  Reading Excel file and use a wildcard in file name and sheet name randolphoralph 6 6,864 Jan-13-2022, 10:20 PM
Last Post: randolphoralph
  Python script for excel sheet Nabil 4 3,225 Jun-01-2021, 05:09 AM
Last Post: Pedroski55
  Add a new column when I extract each sheet in an Excel workbook as a new csv file shantanu97 0 2,192 Mar-24-2021, 04:56 AM
Last Post: shantanu97
  Append excel sheet using openpyxl TammyP 1 2,315 Feb-02-2021, 06:32 PM
Last Post: nilamo
  How to Copy Single Value From One Excel Sheet to Another SunWers 4 4,203 Dec-29-2020, 05:39 PM
Last Post: SunWers
  Writing to existing excel sheet jksvend 0 1,914 Oct-12-2020, 11:19 AM
Last Post: jksvend
  Create new Excel instead of update certain sheet Pietertl 1 1,961 Sep-17-2020, 07:04 AM
Last Post: Pietertl

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020