<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>VBA on Remko's Blog</title><link>https://remkoweijnen.nl/blog/tags/vba/</link><description>Recent content in VBA on Remko's Blog</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Wed, 22 May 2013 11:36:48 +0000</lastBuildDate><atom:link href="https://remkoweijnen.nl/blog/tags/vba/index.xml" rel="self" type="application/rss+xml"/><item><title>Programmatically set Excel LinkedCell property with VBA</title><link>https://remkoweijnen.nl/blog/2013/05/22/programmatically-set-excel-linkedcell-property-with-vba/</link><pubDate>Wed, 22 May 2013 11:36:48 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2013/05/22/programmatically-set-excel-linkedcell-property-with-vba/</guid><description>&lt;p&gt;Yesterday I was working with an Excel document that contained Combobox form controls.&lt;/p&gt; &lt;p&gt;I wanted to count the number of cells containing a particular value using the &lt;a href="http://office.microsoft.com/en-001/excel-help/countif-function-HP010342346.aspx" target="_blank"&gt;COUNTIF&lt;/a&gt; formula. However the count returned 0 because the LinkedCell property of the Combobox was not set to the Cell that contained the Combobox.&lt;/p&gt; &lt;p&gt;To set the LinkedCell Ctrl-Click the Combobox to select it, right-click and select Format Control. Then set the correct Cell in the Cell link field:&lt;/p&gt; &lt;p&gt;&lt;a class="glightbox thickbox" href="https://remkoweijnen.nl/blog/wp-content/uploads/2013/05/SNAGHTML18f5a4ba.webp" data-type="image" data-gallery="post-3229"&gt;&lt;img loading="lazy" decoding="async" style="display: inline" title="SNAGHTML18f5a4ba" alt="SNAGHTML18f5a4ba" src="https://remkoweijnen.nl/blog/wp-content/uploads/2013/05/SNAGHTML18f5a4ba_thumb.webp" width="240" height="226" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;My sheet contained about 150 Comboboxes, so obviously I was going to do this using a script. I couldn't find anything useful with Google so I wrote my own Macro.&lt;/p&gt;</description></item></channel></rss>