title: Javascript Conversion from VBA
body: <p>I am trying to convert a script from VBA to Javascript and I need help. The purpose is to move a spreadsheet into GDocs. First of all here's what the VBA script does along with its code.</p>
  
  <pre><code>Dim lngN As Long
  Dim lngCol As Long
  
  Cells.Unmerge
  With ActiveSheet.UsedRange
  On Error Resume Next
  Range("A8:A100").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
  On Error GoTo 0
  Dim toDel(), i As Long
      Dim RNG As Range, Cell As Long
      Set RNG = Range("A9:J100")
  
     RNG.RemoveDuplicates Columns:=9
     Dim rLastRow As Range
  Set rLastRow = Cells(Rows.Count, "A").End(xlUp)
  
  'now delete last 10 rows:
  rLastRow.Offset(0).Resize(2).EntireRow.Delete
  
  
  Set sourceSheet = Worksheets("BMS Input")
  sourceSheet.Activate
  sourceSheet.Cells.Select
  Selection.Copy
  Set destSheet = Worksheets("BMS Data")
  destSheet.Activate
  destSheet.Cells.Select
  destSheet.Paste
  Sheets("BMS Input").Visible = False
  MsgBox ("Data Input Successful")
  MsgBox ("Please allow form data to update. This process may take up to 1 minute.")
  ActiveWorkbook.RefreshAll
  End With
  End Sub
  </code></pre>
  
  <p>It does the following functions.</p>
  
  <ol>
  <li>Unmerge all cells in the table</li>
  <li>Delete all rows with no data in the first column</li>
  <li>Delete all rows that have duplicate data in the 9th column</li>
  <li>Delete the last 10 rows</li>
  <li>After it's done with all that it copys the entire spreadsheet and pastes it to another spreadsheet in the workbook</li>
  <li>Refreshes the workbook to get latest data</li>
  </ol>
  
  <p>Is there anyone that can give some guidance as to changes I can/should make in this code to make it work in javascript.</p>
  
  <p>-Thanks in Advance
  J</p>