title: excel vba: sheet name as variable
body: <p>I am trying to select a sheet based on the variable. I could successfully rename the sheet with variable sname but could not activate the same </p>
  
  <pre><code>Dim sname as String
  sname = Trim(Cells(row, 12).Value)
  Sheets("Blank (2)").name = sname
  Sheets(sname).Activate
  Sheets(sname).Select
  </code></pre>