Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Recognizing cell colors in excel

echenty
7 - Meteor

Hello! Does anyone know if Alteryx can recognize cell colors from excel? I have a report that has been color-coded and I'd like to bring this dimension of detail into my dataset. Has anyone done this before? I've attached the excel file. Sheets I'm looking to parse are on sheet 49 and 50.

 

Thanks!

6 REPLIES 6
jdunkerley79
ACE Emeritus
ACE Emeritus

Alteryx's import is only the data not the formatting of the source document.

 

I think the easiest way is to do create a small VBA macro to extract the colour to a new column containing the colour and then you can import.

 

Something like:

Option Explicit

Function CellColour(ByRef targetCell As Range)
    CellColour = targetCell.Interior.Color
End Function

will give you an colour code for each cell.

 

echenty
7 - Meteor

Thanks for relaying the command! I've never built anything in VBA so I will take a look :)

 

 

Juandviaje
5 - Atom

Hello I don't know how to use VBA can you give us an example please, I have the same problem here with colors

WilliamR
Alteryx
Alteryx

hello @echenty ,

if you want I have written an article on this topic, with the Python tool.

https://community.alteryx.com/t5/Base-de-Connaissance-Francais/Extraire-la-couleur-des-cellules-d-un...

If you think it can be helpfull, I can help you to use it as it has been written in French.

 

(If this post helps, then please consider Accept it as the solution to help the other members find it more quickly).

TonyAdam
8 - Asteroid

Thanks @WilliamR!

 

Great solution with the Python Tool. I managed to make it work although my French is very limited 😉

PuffinPanic
9 - Comet
9 - Comet

Thanks for the great article. My French was up to it, unfortunately, my knowledge of Python is far behind my understanding of French. 

I updated the filepath in the text input to the location of the test file, but I get the following error:

PuffinPanic_1-1675093310979.png

Can anyone point me in the direction of what is causing this please?

 

Thanks

Labels