Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Sum a Spreadsheet Column from Access

How do I get this to work when calling it from Access?

I'm calling a sql server stored procedure from access and placing the
recordset into excel. I want to total columns "H","I","J" and "K". This
code works in a macro I have in excel but doesn't work when called from
Access.

When i try to compile it , I get a compile error and the word "Sum" is
highlighted in the columntotal sub procedure

xlApp.Workbooks(1).Worksheets(4).Select
ColumnTotal "H"
ColumnTotal "I"
ColumnTotal "J"
ColumnTotal "K"

End Sub

Sub ColumnTotal(ByVal strColumn As String)
Cells(Rows.Count, strColumn).End(xlUp).Offset(2, 0).Value = _
Application.Sum(Columns(strColumn))
End Sub
--
Billy Rogers

Dallas,TX

Currently Using Office 2000 and Office 2003
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Import Spreadsheet into Access Jon Excel Worksheet Functions 1 May 30th 08 02:33 PM
restrict access to a column of a spreadsheet James Excel Discussion (Misc queries) 1 March 18th 08 08:00 PM
link spreadsheet to access? Janis Excel Discussion (Misc queries) 0 September 19th 07 01:56 AM
need help with using VBA to access a second spreadsheet [email protected] Excel Discussion (Misc queries) 2 September 13th 07 12:47 PM
cannot access excel spreadsheet Renn Excel Discussion (Misc queries) 2 October 5th 05 12:23 PM


All times are GMT +1. The time now is 11:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"