Results 1 to 8 of 8

Thread: Using Excel To Create Reports

Hybrid View

  1. #1
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Using Excel To Create Reports

    Your code isn't quite right.. see my Excel tutorial (link in my signature) for the correct methods.

  2. #2

    Thread Starter
    Member
    Join Date
    Feb 2007
    Posts
    37

    Re: Using Excel To Create Reports

    Hi Si _the_geek thanks i have try out it work. now i have another problem is where i need to print something like his
    Code:
    Movie id        Movie Name           Price
    
    SD1              Superman                    9
    MT1               Matrix                         9
    but what i get is something like this

    Code:
    Movie id                      Movie Name          P rice
    SD1                                MT1
    Superman                           Matrix     
    9                                         9

    pls help me below is my coding

    vb Code:
    1. Dim objexcel As Excel.Application
    2. Dim objsheet As Excel.Worksheet
    3. Dim objbook As Excel.Workbook
    4.  
    5.  
    6. Set objexcel = New Excel.Application
    7. Set objbook = objexcel.Workbooks.Add
    8. Set objsheet = objbook.Worksheets(1)
    9.  
    10. objexcel.Visible = True
    11. For i = 0 To titlecount - 1
    12. objsheet.Cells(1, i + 2).Value = List1.List(i)
    13.  
    14.  
    15. objsheet.Cells(1, 2, i + 1).Value = List2.List(i)
    16.  
    17.  
    18. objsheet.Cells(3 i + 1).Value = List3.List(i)
    19. Next
    Last edited by si_the_geek; Apr 6th, 2007 at 08:52 AM. Reason: added code tags to keep data format

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width