title: Searching and Returning bold values in VBA
body: <p>I know that this probably isn't the most ideal way to to do this but just bear with me. </p>
  
  <p>I have a document with a few tables on it. I'm using a userform to search the tables/sub-categories and return the relevant values. I want to select the sub categories with a range of option buttons on a userform, these will in turn set the range for the search function to look within. I also want to dynamically update the option buttons if a new table was to be added or anything along those lines. </p>
  
  <p>The only thing that differentiates the title of a sub-category/table, and the items within it, is that the title of a sub-category/table is bold. So what I'm looking to do is search the first column of the spreadsheet and return the names of any entries in bold. These values are then used to set the names of the option buttons :).</p>
  
  <p>The following function is my attempt at finding the text entities in column a that are in bold, returning them and setting each to an individual variable to be used in another function. The <code>bold1</code> .... variables are all globally defined variables as I need them in another sub, as is the <code>page</code> variable which contains the relevant page to be used. Currently the code returns an error stating "variable or with block not set" and using the debugger I can see that <code>bold1</code> .... and all the other boldx variables have no value set. Does anybody know whats going on/how to fix this function.</p>
  
  <p>Thanks in advance :)</p>
  
  <pre><code>Sub SelectBold()
      Dim Bcell As Range
      For Each Bcell In Worksheets(Page).Range("A1:A500")
          If Bcell.Font.Bold = True Then
              Set bold1 = Bcell
          End If
      Next
  End Sub
  </code></pre>
  
  <p>EDIT: I simplified the above function, to remove clutter and help narrow in on the issue. I want the above function to store the contents of the found cell (any cell in the document in bold at this stage) in the variable <code>bold1</code></p>