title: How to Store a Folder Path in Excel VBA
body: <pre><code>Sub GetFolderPath()
  Dim InputFolder As String
  Dim OutputFolder As String
  
  InputFolder = Application.GetOpenFilename("Folder, *")
  Range("C1").Select
  ActiveCell.Value = InputFolder &amp; "\"
  
  End Sub
  </code></pre>
  
  <p>I am using the code above to attempt to store, and then paste, a folder location for another macro I am running.</p>
  
  <p>Any idea how to make it stop at the folder level or remove the filename from the end?</p>
  
  <p>Thanks!</p>