title: Adding different randomly generated numbers in an Excel sheet with VB.NET
body: <p>So i have an excel sheet which i am adding data to. I have made headers  </p>
  
  <pre><code>        Dim xlApp As Excel.Application
          Dim xlWorkBook As Excel.Workbook
          Dim xlWorkSheet As Excel.Worksheet
          Dim xlRange As Excel.Range
          Dim misValue As Object = System.Reflection.Missing.Value
          Dim rNum As Random = New Random
  
          xlApp = New Excel.Application
          xlWorkBook = xlApp.Workbooks.Add(misValue)
          xlWorkSheet = xlWorkBook.Sheets("sheet1")
          xlRange = xlWorkSheet.UsedRange
  
          With xlWorkSheet
              .Range("A1").Value = "col1"
              .Range("B1").Value = "col2"
              .Range("C1").Value = "col3"
              .Range("D1").Value = "col4"
              .Range("E1").Value = "col5"
              .Range("F1").Value = "col6"
          End With
  </code></pre>
  
  <p>what i would like to do for col5 is have every row and individual, randomly generated number using rNum to do it. So far i have been able to populate multiple rows in the column but it is the same number and not unique</p>
  
  <p>Any advice on this?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>The only code i had was this:</p>
  
  <pre><code>xlWorkSheet.Range("E2:E10").Value = rNum.Next()
  </code></pre>