PC Review


Reply
Thread Tools Rate Thread

Access VBA creating an Excel spreadsheet with a total line

 
 
PSULionRP
Guest
Posts: n/a
 
      22nd Dec 2009
I have an Access module which dynamically creates an Excel spreadsheet. Now
the Business User has asked that we put a Total Line in the Excel spreadsheet.

How do I within Access VBA determine the range, because the spreadsheet will
never be the same, and then use that range to create a formula to insert to
the local recordset which dynamically creates the Excel spreadsheet with the
Total Line???

Thanks in advance for your review and help and hopeful for a reply.

PSULionRP
 
Reply With Quote
 
 
 
 
James A. Fortune
Guest
Posts: n/a
 
      23rd Dec 2009
On Dec 22, 10:35 am, PSULionRP <PSULio...@discussions.microsoft.com>
wrote:
> I have an Access module which dynamically creates an Excel spreadsheet. Now
> the Business User has asked that we put a Total Line in the Excel spreadsheet.
>
> How do I within Access VBA determine the range, because the spreadsheet will
> never be the same, and then use that range to create a formula to insert to
> the local recordset which dynamically creates the Excel spreadsheet with the
> Total Line???
>
> Thanks in advance for your review and help and hopeful for a reply.
>
> PSULionRP


If the first empty data row indicates the end of the data, combine:

http://groups.google.com/group/micro...ed3b336e50b264

with VBA code in Access something like (air code):

For lngJ = 1 To lngMaxNumberOfRowsWithData
boolContinue = False
For I = 1 To intNumberOfColumnsWithData
If objXL.Cells(I, lngJ).Value <> "" Then
boolContinue = True
Exit For 'Found some data in the row so go to the next row
End If
Next I
If boolContinue = False Then Exit For 'All data columns are empty
Next lngJ
If lngJ <> lngMaxNumberOfRowsWithData Then
MsgBox("Put the SUM formulae in row " & CStr(lngJ))
Else
MsgBox("Put the SUM formulae in row " & CStr(lngJ + 1))
End If

James A. Fortune
(E-Mail Removed)
 
Reply With Quote
 
James A. Fortune
Guest
Posts: n/a
 
      23rd Dec 2009
On Dec 22, 10:35 am, PSULionRP <PSULio...@discussions.microsoft.com>
wrote:
> I have an Access module which dynamically creates an Excel spreadsheet. Now
> the Business User has asked that we put a Total Line in the Excel spreadsheet.
>


I should have read that more closely. If you are creating the
spreadsheet, you know where the data ends and can put the SUMs in
right then, correct?.

James A. Fortune
(E-Mail Removed)
 
Reply With Quote
 
dame
Guest
Posts: n/a
 
      25th Dec 2009
et alors on fait quoi

"PSULionRP" <(E-Mail Removed)> a écrit dans le message de
groupe de discussion : 44A8B442-9F4E-459C-98C2-(E-Mail Removed)...
> I have an Access module which dynamically creates an Excel spreadsheet.
> Now
> the Business User has asked that we put a Total Line in the Excel
> spreadsheet.
>
> How do I within Access VBA determine the range, because the spreadsheet
> will
> never be the same, and then use that range to create a formula to insert
> to
> the local recordset which dynamically creates the Excel spreadsheet with
> the
> Total Line???
>
> Thanks in advance for your review and help and hopeful for a reply.
>
> PSULionRP


 
Reply With Quote
 
aleyna
Guest
Posts: n/a
 
      10th Jan 2010

"PSULionRP" <(E-Mail Removed)>, iletisinde şunu yazdı,
news:44A8B442-9F4E-459C-98C2-(E-Mail Removed)...
>I have an Access module which dynamically creates an Excel spreadsheet. Now
> the Business User has asked that we put a Total Line in the Excel
> spreadsheet.
>
> How do I within Access VBA determine the range, because the spreadsheet
> will
> never be the same, and then use that range to create a formula to insert
> to
> the local recordset which dynamically creates the Excel spreadsheet with
> the
> Total Line???
>
> Thanks in advance for your review and help and hopeful for a reply.
>
> PSULionRP
>
> __________ ESET NOD32 Antivirus Ak�ll� G�venlik taraf�ndan sa�lanan
> bilgiler, vir�s imza veritaban� s�r�m�: 4716 (20091225) __________
>
> �leti ESET NOD32 Antivirus Ak�ll� G�venlik taraf�ndan denetlendi.
>
> http://www.nod32.com.tr
>
>
>


 
Reply With Quote
 
van.dam.ronny.
Guest
Posts: n/a
 
      29th Jan 2010

"Åke Eriksson" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed)...
> Kan vara snäll hjälpa mig att ja komma in
> "aleyna" <(E-Mail Removed)> skrev i meddelandet
> news:(E-Mail Removed)...
>>
>> "PSULionRP" <(E-Mail Removed)>, iletisinde şunu yazdı,
>> news:44A8B442-9F4E-459C-98C2-(E-Mail Removed)...
>>>I have an Access module which dynamically creates an Excel spreadsheet.
>>>Now
>>> the Business User has asked that we put a Total Line in the Excel
>>> spreadsheet.
>>>
>>> How do I within Access VBA determine the range, because the spreadsheet
>>> will
>>> never be the same, and then use that range to create a formula to insert
>>> to
>>> the local recordset which dynamically creates the Excel spreadsheet with
>>> the
>>> Total Line???
>>>
>>> Thanks in advance for your review and help and hopeful for a reply.
>>>
>>> PSULionRP
>>>
>>> __________ ESET NOD32 Antivirus Ak�ll� G�venlik taraf�ndan sa�lanan
>>> bilgiler, vir�s imza veritaban� s�r�m�: 4716 (20091225) __________
>>>
>>> �leti ESET NOD32 Antivirus Ak�ll� G�venlik taraf�ndan denetlendi.
>>>
>>> http://www.nod32.com.tr
>>>
>>>
>>>

>>

>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating an Excel Spreadsheet from Access ChrisJLT Microsoft Access 1 21st Sep 2009 01:00 PM
Creating an Excel spreadsheet via Access VBA PSULionRP Microsoft Access VBA Modules 1 28th Mar 2009 01:28 AM
Creating a total line jln via OfficeKB.com Microsoft Excel Programming 4 13th Sep 2006 02:31 AM
Creating an Access Report using an Excel spreadsheet Drummer2004@gmail.com Microsoft Access VBA Modules 1 4th Jan 2006 07:29 PM
Creating Excel Spreadsheet within Access VBA =?Utf-8?B?cm1jb21wdXRl?= Microsoft Access Macros 1 14th Mar 2005 08:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:41 PM.