title: PyWin32 Excel Integration - Getting Values of Non-Contiguous Cells
body: <p>I think I'm doing something fundamentally wrong here.  I want to grab the values in a given range of cells without using a loop (getting/setting values for large amounts of data seems very slow using loops, so I figured I'd try to grab big blocks of data at a time).</p>
  
  <p>As a small example, let's say I have an Excel spreadsheet with values in cells A1, A3, and A5.  I would like to pull those values into a list.  But unfortunately, when I execute the code below, I'm only getting the value of A1.  Not any of the others.</p>
  
  <pre><code>import win32com.client as win32
  excel = win32.gencache.EnsureDispatch('Excel.Application')
  excel.Visible = True
  
  wb = excel.Workbooks.Add()
  ws = wb.Worksheets("Sheet1")
  
  val = wb.ActiveSheet.Range('A1,A3,A5').Value
  print val
  </code></pre>
  
  <p>If I were to say, want a contiguous list of values, the following line does that:</p>
  
  <pre><code>val = wb.ActiveSheet.Range('A1:A5').Value
  </code></pre>
  
  <p>And it gives me a list.  But since the values I want may not be contiguous, this approach won't work.  The values will always be from the same column (in this example, "A"), but not necessarily contiguous rows.</p>
  
  <p>Hopefully that makes sense.  If not, I can clarify.  Thank you for any and all help!!  :)</p>