title: Create New String Variables based on conditional statement and "merging" .dat files?
body: <p>I'm trying to write a program that merge two or more .dat files in VBA excel. Basically, it first asks the user to select any number of files (more than 2). Then it "merges" the files based on the order that the user had selected them. By merge, I mean append or copy and paste one selected file into the previous selected file, and save as a brand new file. I'm stuck on on creating the new variables as Strings part, since I'm used to having the open prompt window pop up for just one file that need to be opened. Now it is conditional based on user's selection at the message box of whether he wants another file merged with the previous. It keeps asking this until the user selects no or cancel. So each time the user selects yes there needs to be a new variable created to store the file name to be opened later. How do I go about this process? And also How do I open up all of these files at the same time once the user hits "no" to stop merging the files, and is there any clever way to append or Copy and Paste .dat files, I've tried Hex Editor: HxD, How do I manipulate the Hex Edit program with VBA?</p>
  
  <pre><code>   Sub Merge()
      Dim Response, Message As String
    Dim File1 As String 'Needs new variable created each time user selects "ok" on msgbox
     ChDir "C:\"
  
  File1 = Application.GetOpenFilename(Title:="Select File to be Merged")
  If File1 = "False" Then Exit Sub
  Message = "Select Another File To be Merged With?"
  Response = MsgBox(Message, vbQuestion + vbOKCancel, "Merge Files")
   If Response = vbOK Then
    'Loop-mechanism to create a new variable each time. HOW?
  
   Else
  'Open .dat files and start the copy and pasting process HOW with Hex Editor?:I'm using a program called "HxD"
   End If
   End Sub
  </code></pre>
  
  <p>Thanks!</p>