Forum Discussion
Preserve cell fill color when importing from web
I am importing data to Excel from a website using power query and I have a big problem, the data is imported great but there is a very important fact that I lose, the fill color of the original page. Although in the preview of the web to load it comes out, I lose it.
Any ideas please? I've looked up on chatgpt and nothing...
5 Replies
- BA_Pete
Super User
Hi Edusegoviano ,
Power Query only deals in data, not colours/formatting etc.
You would need to understand the logic that determines the colour on the website, then apply that logic to your values using conditional formatting in Excel.
Pete
- EdusegovianoNew Member
Thank you BA_Pete , but in that case background color of each cell is an important data. Each color means different things, and I need that data
- BA_Pete
Super User
In that case, you may be able to scrape the colour value fom the website HTML.
In Power Query you can use the Web connector dialog to pick out HTML segments from websites so you could, in theory, identify the colour along with the value, but I've never done it that in-depth before myself and sounds like it could get quite fiddly.
Have a go at connecting to the site using the web connector then see if you can identify the correct part of the HTML using the 'Table From Examples' button.
Pete