title: How can I write data in different sheets?
body: <p>I need to input information on a Excel file. My code creates a file with different sheet names.</p>
  <p>Now I need to write in each column stuff like:</p>
  <pre class="lang-vb prettyprint-override"><code>Dim oExcel As Object
  Dim oBook As Object
  Dim oSheet As Object
  
  'Start a new workbook in Excel    
  oExcel = CreateObject(&quot;Excel.Application&quot;)
  oBook = oExcel.Workbooks.Add
  
  'Creating Columns with names 
  oSheet.Range(&quot;A1&quot;).Value = &quot;Date&quot;
  oSheet.Range(&quot;A2&quot;).Value = Now
  oSheet.Range(&quot;B1&quot;).Value = &quot;Category&quot;
  oSheet.Range(&quot;C1&quot;).Value = &quot;Correct&quot;
  oSheet.Range(&quot;D1&quot;).Value = &quot;Answer&quot;
  oSheet.Range(&quot;E1&quot;).Value = &quot;Time&quot;
  </code></pre>
  <p>This writes the information in the same sheet in the corresponding column, but how can I write in different sheets?</p>
  <p>I generate the sheets with:</p>
  <pre><code>'Adding Sheets To the excel 
  'oBook.Worksheets.add.Name = &quot;Sounds&quot;
  'oBook.Worksheets.add.Name = &quot;Colors&quot;
  'oBook.Worksheets.add.Name = &quot;Animals&quot;
  'oBook.Worksheets.add.Name = &quot;Forms&quot;
  </code></pre>
  <p>So to clarify, I want to write the &quot;Date&quot;, &quot;Category&quot;, &quot;correct&quot;, &quot;answer&quot;, &quot;Time&quot; in each of the generated sheets, and not in one sheet.</p>