{"id":378,"date":"2024-04-01T08:04:42","date_gmt":"2024-04-01T08:04:42","guid":{"rendered":"https:\/\/datadandies.nl\/?p=378"},"modified":"2024-04-01T08:04:42","modified_gmt":"2024-04-01T08:04:42","slug":"vul-een-kolom-in-excel-op-basis-van-de-achtergrondkleur-van-een-cel-met-behulp-van-een-zelf-ontwikkelde-functie","status":"publish","type":"post","link":"https:\/\/datadandies.nl\/index.php\/2024\/04\/01\/vul-een-kolom-in-excel-op-basis-van-de-achtergrondkleur-van-een-cel-met-behulp-van-een-zelf-ontwikkelde-functie\/","title":{"rendered":"Vul een kolom in Excel op basis van de achtergrondkleur van een cel met behulp van een zelf ontwikkelde functie"},"content":{"rendered":"\n<p>Stel dat je in een tabel in Excel een kolom wil toevoegen waarbij je elke rij op basis van de achtergrondkleur van een cel een waarde wil geven. Bijvoorbeeld: wanneer cel A2 geel is, moet cel B2 de \u201cBehouden\u201d bevatten.<\/p>\n\n\n\n<p>Je kunt dit oplossen met een zelfgemaakte functie in Excel. Dit is vrij eenvoudig te doen.<\/p>\n\n\n\n<p>Wanneer je in het betreffende Excel bestand bent, druk op alt+f11. Vervolgens klik je binnen het nieuwe venster wat nu opent op Insert &gt; Module. Je kunt nu je eigen functie defini\u00ebren zoals hieronder:<\/p>\n\n\n\n<p>Function GetFillColor(Rng As Range) As Long<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; GetFillColor = Rng.Interior.ColorIndex<\/p>\n\n\n\n<p>End Function<\/p>\n\n\n\n<p>Deze functie retourneert een ColorIndex en zodoende kun je deze functie in een IF-functie gebruiken om zo de kolom als gewenst te vullen. Dank aan de gebruiker \u201castef\u201d op Reddit die me hierop gewezen heeft.<\/p>\n\n\n\n<p>Wat extra info over zelfgemaakte functies in Excel:<br>https:\/\/www.wikihow.com\/Create-a-User-Defined-Function-in-Microsoft-Excel<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"517\" src=\"https:\/\/datadandies.nl\/wp-content\/uploads\/2024\/04\/20240401-Create-your-own-Excel-Function-fill-a-column-based-on-cell-background-colors-1024x517.png\" alt=\"\" class=\"wp-image-379\" srcset=\"https:\/\/datadandies.nl\/wp-content\/uploads\/2024\/04\/20240401-Create-your-own-Excel-Function-fill-a-column-based-on-cell-background-colors-1024x517.png 1024w, https:\/\/datadandies.nl\/wp-content\/uploads\/2024\/04\/20240401-Create-your-own-Excel-Function-fill-a-column-based-on-cell-background-colors-300x152.png 300w, https:\/\/datadandies.nl\/wp-content\/uploads\/2024\/04\/20240401-Create-your-own-Excel-Function-fill-a-column-based-on-cell-background-colors-768x388.png 768w, https:\/\/datadandies.nl\/wp-content\/uploads\/2024\/04\/20240401-Create-your-own-Excel-Function-fill-a-column-based-on-cell-background-colors-1536x776.png 1536w, https:\/\/datadandies.nl\/wp-content\/uploads\/2024\/04\/20240401-Create-your-own-Excel-Function-fill-a-column-based-on-cell-background-colors-2048x1035.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Stel dat je in een tabel in Excel een kolom wil toevoegen waarbij je elke rij op basis van de achtergrondkleur van een cel een waarde wil geven. Bijvoorbeeld: wanneer cel A2 geel is, moet cel B2 de \u201cBehouden\u201d bevatten. Je kunt dit oplossen met een zelfgemaakte functie in Excel. Dit is vrij eenvoudig te&hellip;<\/p>\n<p class=\"more-link\"><a href=\"https:\/\/datadandies.nl\/index.php\/2024\/04\/01\/vul-een-kolom-in-excel-op-basis-van-de-achtergrondkleur-van-een-cel-met-behulp-van-een-zelf-ontwikkelde-functie\/\" class=\"themebutton\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-378","post","type-post","status-publish","format-standard","hentry","category-blog"],"_links":{"self":[{"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/posts\/378","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/comments?post=378"}],"version-history":[{"count":1,"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/posts\/378\/revisions"}],"predecessor-version":[{"id":380,"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/posts\/378\/revisions\/380"}],"wp:attachment":[{"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/media?parent=378"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/categories?post=378"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/tags?post=378"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}