Zuma Lifeguard Wiki
No edit summary
Line 9: Line 9:
 
ThisWorkbook.ActiveSheet.Columns("A:A").EntireColumn.AutoFit
 
ThisWorkbook.ActiveSheet.Columns("A:A").EntireColumn.AutoFit
   
==Create Excel sheet from non-Excel app===
+
==Create Excel sheet from non-Excel app==
Dim e As New Excel.Application: e.Application.Visible = True
+
Dim e As New Excel.Application: e.Application.Visible = True
 
Dim w As Excel.Workbook: Set w = e.Workbooks.Add
 
Dim w As Excel.Workbook: Set w = e.Workbooks.Add
 
w.ActiveSheet.Range("A5").Value = "hello"
 
w.ActiveSheet.Range("A5").Value = "hello"

Revision as of 01:00, 20 April 2010

Clear contents of a range

ThisWorkbook.ActiveSheet.Columns("A:C").Select
   Selection.ClearContents

Set a cell

ThisWorkbook.ActiveSheet.Range("A5").Value = "hello"

Auto fit a column

ThisWorkbook.ActiveSheet.Columns("A:A").EntireColumn.AutoFit

Create Excel sheet from non-Excel app

Dim e As New Excel.Application: e.Application.Visible = True
   Dim w As Excel.Workbook: Set w = e.Workbooks.Add
   w.ActiveSheet.Range("A5").Value = "hello"