title: How to send a range of cell values to web page text input field
body: <p>I am writing an Excel macro, using Selenium basic, to download data from a web-based tool.</p>
  <p>Using Selenium, I need to select 200 cells in a column in Excel and send them to a text box in a webpage.</p>
  <p>The following line does this with the single cell A1:</p>
  <pre><code>driver.FindElementById(&quot;batch_requests&quot;).SendKeys [A1]
  </code></pre>
  <p>How can I send the entire range A1:A200?</p>
  <p>Looping through and doing one at a time would be too time-consuming, as there are thousands of data points I need to paste 200 at a time.</p>
  <p>Using standard sendkeys in VBA (not Selenium) is not a good solution, because the computer will be in use while the macros run in the background.</p>
  <p><strong>EDIT - Qharr's answer fitted to my needs</strong></p>
  <p>Not the most elegant solution, but it works every time in the situation(s) I will be using it.</p>
  <pre class="lang-vb prettyprint-override"><code>' Copy column A 200 cells at a time into webpage text input field
  
  Dim clipboard As Object
  Dim data As String
  Dim myRange As Range
  Set clipboard = GetObject(&quot;New:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}&quot;)
  ' See how many rows of data in column A
  numRows = Range(&quot;A1&quot;, Range(&quot;A1&quot;).End(xlDown)).Rows.Count
  
  ' Step through column A, 200 cells at a time (until numRows is exceeded)
  ' and create a range to be copied to clipboard and sent to webpage via Selenium
  ' 'Batch_Requests' is ID of input field page element to send text to.
  
  For x = 2 To numRows Step 200
      Set myRange = Range(&quot;A&quot; &amp; x &amp; &quot;:A&quot; &amp; (x + 200))
      myRange.Copy
      With clipboard
          .GetFromClipboard
          data = .GetText
          driver.FindElementById(&quot;batch_requests&quot;).SendKeys data
      End With
      
      ' *****************************************************************************
      ' Insert Seleneium code here to manipulate the web page with the data
      ' *****************************************************************************
  
      ' Clear text input field
      driver.FindElementById(&quot;batch_requests&quot;).Clear
  
  ' Go to next 200 in column A (until none left)
  Next x
  </code></pre>