Form/Subfrm to Excel Spreadsheet

renenger

Registered User.
Local time
Yesterday, 20:09
Joined
Oct 25, 2002
Messages
117
I have been rummaging through a variety of posts regarding the transfer of data to an Excel spreadsheet. I found some code that works fantastically to export the form information to specific fields on the spreadsheet.

The problems is that in the middle of my spreadsheet I have a range of cells (A24:J32) that holds the options selected for a unit. There could be multiple options chosen but generally no more than 10. The cells read:

Opt ID, Descritption, Cost, Opt ID, Description, Cost

I need to fill this across and then down. I have a query "qryContractOptionExcelOutput" that pulls the subtbl data that I need, I am just not sure how to populate these cells with it.

Here is what I have so far.

Private Sub Command146_Click()


Dim objXLApp As Object
Dim objXLBook As Object
Set objXLApp = CreateObject("Excel.Application")
Set objXLBook = objXLApp.Workbooks.Open("C:\Documents and Settings\brenenger\Desktop\SeqSheet.xls")
objXLApp.Application.Visible = True

objXLBook.ActiveSheet.Range("A5") = Me.BuilderName
objXLBook.ActiveSheet.Range("C5") = Me.JobName
objXLBook.ActiveSheet.Range("E5") = Me.Tract
objXLBook.ActiveSheet.Range("G5") = Me.City
objXLBook.ActiveSheet.Range("E17") = Me.City
objXLBook.ActiveSheet.Range("I5") = Me.OrderDate

objXLBook.ActiveSheet.Range("A7") = Me.ProjectID
objXLBook.ActiveSheet.Range("C7") = Me.Super
objXLBook.ActiveSheet.Range("E7") = Me.TractPhone
objXLBook.ActiveSheet.Range("G7") = Me.TractFax
objXLBook.ActiveSheet.Range("I7") = Me.SuperCell

objXLBook.ActiveSheet.Range("A15") = Me.Unit
objXLBook.ActiveSheet.Range("C15") = Me.Phase
objXLBook.ActiveSheet.Range("E15") = Me.PlanNo & " " & Me.Type
objXLBook.ActiveSheet.Range("G15") = Me.BoxCount
objXLBook.ActiveSheet.Range("I15") = Me.PO

End Sub

Any ideas would be greatly appreciated!!!
 

Users who are viewing this thread

Back
Top Bottom