title: Opening files from a folder using values stored in a range
body: <p>I have the following code to open a file that contains a number that is usually ten digits.</p>
  <p>I would like the code to refer to my worksheet for that number rather than mentioning it in the code.</p>
  <p>When I try the Range formula, it doesn't work because the number is too large to be stored as an integer. If I store this number as text, it's not able to locate the file.</p>
  <pre class="lang-vb prettyprint-override"><code>Sub OpenFiles()
      
      Dim MyFolder As String
      Dim MyFile As String
  
      MyFolder = &quot;H:\Test\&quot; 'EXACT folder name containing the files. 
                            'Change to suit, but don't forget the trailing backslash '\'
      MyFile = Dir(MyFolder &amp; &quot;\*2964179000*.xlsm&quot;)
      
      Do Until MyFile = &quot;&quot;
          Workbooks.Open Filename:=MyFolder &amp; &quot;&quot; &amp; MyFile
          MyFile = Dir
      Loop
      
  End Sub
  </code></pre>