title: In VBA, referencing an Excel worksheet using a variable in VBA
body: <p>I have a variable called 'attached' that increments each time a certain condition is verified as true.  When that condition is true, I'm trying to select a worksheet that was created earlier that has the name "Attachment(x)". 'x' is a number 2,3,4, etc.  For instance, a worksheet might have the name "Attachment (3)".  In my code, x will be the value that the incrementing variable 'attached' has achieved at that point.</p>
  
  <p>What code will select the worksheet based upon the current value of the variable 'attached'?  I declared the variable attached as a variant......Dim attached As Variant.</p>
  
  <p>I just keep getting errors.</p>
  
  <p>Thanks</p>