title: VBA query: using clipboard data to filter
body: <p>I'm using multiple worksheets in Excel to create a database of candidates undergoing some technical training.  Each time a candidate is added to the 'database' they are assigned a unique number, for example "2015-0001".  When they call to pay their deposit, I'm using a data input table for the telephone operator to note down the details, and it looks up the unique number for the candidate.  I then want to filter the main database for the candidate by their number and paste in the confirmed details of the deposit.</p>
  
  <p>My query is this: how do I write the code that copies the candidate number data from the cell on worksheet 1 and then uses that data (irrespective of its value) to filter worksheet 2?</p>
  
  <p>I'm new to macros and have been using "record macro" to generate code which I then edit and learn as I go.  So, apologies if this looks extremely clunky.  Using record, the filter command simply takes the example text I'm using (in this case 2015-0011), not replacing it with the revised value when the Deposit input table is changed and the macro is run.  Am I right to think that I need to use a String?</p>
  
  <p>Thanks in advance.  RLC</p>
  
  <pre><code>Sub Confirm_Deposit()
  '
  ' Confirm_Deposit Macro
  '
  
  
  '
      Sheets("Take Deposit").Select
      Range("C5").Select
      Selection.Copy
      Sheets("CIP Candidates").Select
      ActiveSheet.Range("$A$6:$AK$2507").AutoFilter Field:=1, Criteria1:= _
          "2015-0011"                     &lt;---------------- ISSUE
      Sheets("Take Deposit").Select
      Range("C6:C8").Select
      Application.CutCopyMode = False
      Selection.Copy
      Sheets("CIP Candidates").Select
      Range("A6").Select
      Range(Selection, Selection.End(xlDown)).Select
      Selection.Offset(0, 20).Select
      Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
          :=False, Transpose:=True
      Application.Run _
          "'CIP Spreadsheet RLC (with Macros).xlsm'!ThisWorkbook.Clear_Filters"
  
  
  etc.
  </code></pre>