Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export VB data report to Excel Format?

Status
Not open for further replies.

MathiKrishna

Programmer
Mar 27, 2002
13
0
0
IN
Hai
1. I want to export my data report to Excel format.
How can I do that,pls help me. I have nearly 150 data as of
Application form
2. HOw can I do Multiple grouping at the same level
FOr eg:
Name : --------------
DOB : --------------


Qualification Details:
-----------
----------
----------
Employment History :
-----------------------
--------------------------
-------------------------
--------------------------
KEEP SMILING TODAY AND ALWAYS
Regards,
Mathi Krishna
 
Try This - Hope it helps.

First Add 'Microsoft Excel 8.0 Object Library' from Project|Reference

Dim ExcelApp As Excel.Application
Dim ExcelWorkBK As Excel.Workbook
Dim iRow as Integer

Set ExcelApp = CreateObject("Excel.Application")
Set ExcelWorkBK = ExcelApp.Workbooks.Add
ExcelApp.Visible = False
ExcelWorkBK.Worksheets("Sheet1").Activate

With rsRecordSet
.MoveFirst
Do until not eof()
With ExcelWorkBK.Worksheets("Sheet1")
.Cells(iRow, 1).Value = "Capital One call back pending release"
iRow = iRow + 1
.Cells(iRow, 1).Value = "Name :" & .Fields("Name")
iRow = iRow + 1
.Cells(iRow, 1).Value = "Qualification Details:"
iRow = iRow + 1
.Cells(iRow, 1).Value = .Fields("Quali")
....
....
end with
.MoveNext
Loop
End with

ExcelWorkBK.SaveAs "C:\Text.XLS"
ExcelApp.Quit
Set ExcelWorkBK = Nothing
Set ExcelApp = Nothing

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top