title: Macro to prompt user to select CSV files for import into existing sheet in workbook
body: <p>I am running a macro which automatically takes csv files and import them into specific worksheets in my workbook. However, I would want to add greater flexibility by having the user select the files for import rather than have the macro automatically grab the csv files because the naming could change as well as the directory. I am new to VBA and have been trying to better understand the MsoFileDialogType and GetOpenFilename but having difficulty trying to grasp the concept/implementation into my code.</p>
  
  <p>What I ultimately want is for the user to click a button on the workbook front-end. Be prompted with a message to select the first csv file for import. This csv file will be imported into a pre-named worksheet in the workbook temp1. However since the data files come in pairs, I want the user to be able to select the next csv file after the first one into temp2.</p>
  
  <p>What I have currently is:</p>
  
  <pre><code>Worksheets.Add
  ActiveSheet.Name = "temp1"
  With ActiveSheet.QueryTables.Add(Connection:= _
          "TEXT;MAC Directory path here" _
          , Destination:=Range("A1"))
          .Name = "temp 1 03.02.12"
          .FieldNames = True
          .RowNumbers = False
          .FillAdjacentFormulas = False
          .RefreshOnFileOpen = False
          .BackgroundQuery = True
          .RefreshStyle = xlInsertDeleteCells
          .SavePassword = False
          .SaveData = True
          .AdjustColumnWidth = True
          .TextFilePromptOnRefresh = False
          .TextFilePlatform = xlMacintosh
          .TextFileStartRow = 1
          .TextFileParseType = xlDelimited
          .TextFileTextQualifier = xlTextQualifierDoubleQuote
          .TextFileConsecutiveDelimiter = False
          .TextFileTabDelimiter = False
          .TextFileSemicolonDelimiter = False
          .TextFileCommaDelimiter = True
          .TextFileSpaceDelimiter = False
          .TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _
          1, 1, 1)
          .Refresh BackgroundQuery:=False
          .UseListObject = False
  End With
  ActiveSheet.Move after:=Worksheets(Worksheets.Count)
  </code></pre>
  
  <p>Thank you.</p>