code_junkie

Export tables to excel, including a macro

Nov 12th, 2011
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. function exporttoexcel()
  2. { //export to excel
  3. if (tableSortArray.length > 0)
  4. {
  5. var t, arr;
  6. var tempArray=new Array();
  7.  
  8. for(var i=0; i, i<tableSortArray.length; i++) {
  9. arr = tableSortArray[i].toString();
  10. arrr = (arr.split(","));
  11. if (i==0) { t = arrr[1]; }
  12. else { t += ','+arrr[1]; }
  13. }
  14. document.excel.t.value = t;
  15. }
  16. // I left out some mumbojumbo about sorting here
  17. document.excel.submit();
  18. }
  19.  
  20. ' Delete any old stray copies of the module1
  21. On Error Resume Next
  22. Kill ("C:MrXL1.bas")
  23. On Error GoTo 0
  24. ' Export Module 1
  25. ActiveWorkbook.VBProject.VBComponents("module1").Export ("c:MrXL1.bas")
  26. For x = 1 to 54
  27. ThisBroker = Sheets("BrokerList").range("A" & x).value
Add Comment
Please, Sign In to add comment