title: Excel string variables not working in range
body: <p>I'd really appreciate it if someone could point me to the right direction. I'm trying to do a simple macro to hide selected set of rows. I could combine Set 1 and 2 in the variables, but they are two different sets of information and I want them separated so it is easier to maintain as the code grows.</p>
  <p>I'm wondering if there are ways to see how range resolves my variables.</p>
  <p>This code works</p>
  <pre><code>Const Set1 As String = &quot;1:2,4:5&quot;
  Const Set2 As String = &quot;7:8,11:12&quot;
  
  Sub test()
  
  Worksheets(&quot;Sheet1&quot;).Range(Set1).EntireRow.Hidden = True
  Worksheets(&quot;Sheet1&quot;).Range(Set2).EntireRow.Hidden = True
  
  End Sub
  </code></pre>
  <pre><code>Sub test2()
  Worksheets(&quot;Sheet1&quot;).Range(&quot;1:2,4:5,7:8,11:12&quot;).EntireRow.Hidden = True
  End Sub
  </code></pre>
  <p>But not this</p>
  <pre><code>Const Set1 As String = &quot;1:2,4:5&quot;
  Const Set2 As String = &quot;7:8,11:12&quot;
  
  
  Sub test()
  
  Worksheets(&quot;Sheet1&quot;).Range(Set1, Set2).EntireRow.Hidden = True
  
  End Sub
  </code></pre>