[AccessD] Exporting Access to Excel - How to "SUM" a column with a variable number of rows?

William Benson (VBACreations.Com) vbacreations at gmail.com
Mon Jul 25 13:52:04 CDT 2011


Oops, I threw the function GetXL in as a bonus without removing xl variable.

Function TestFunction ()
   With GetXL
       MsgBox .Sum(.ActiveWorkbook.ActiveSheet.Columns(1))  
   End With
End TestFunction


Function GetXL() As Excel.Application
On Error Resume Next
  Set GetXL = GetObject(, "Excel.Application")
  If GetXL Is Nothing Then
    Set GetXL = CreateObject("Excel.Application")
    GetXL.Visible = True
  End If
exit_me:
End Function	





More information about the AccessD mailing list