Results 1 to 40 of 45

Thread: Writing to Excel

Hybrid View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2006
    Posts
    208

    Re: Writing to Excel

    Hi Rob
    I have got this code, I want it to write first line of listbox1 the a , and then the first line of listbox2, then I want it to go to a new line. This is my code, but it overwrites each time obviously, but I didn't know how to do append the cell so wrote this so someone could modify:

    VB Code:
    1. objExcel.Range("F" & lRow.ToString).Select()
    2.             For index = 0 To lstproname.Items.Count - 1
    3.                 objExcel.ActiveCell.FormulaR1C1 = lstproname.Items(index)   & _    ", " & lstproprice.Items(index) &  vbNewLine
    4.                 index = index +1
    5.             Next

    Thanks

    Sam
    Last edited by samtaylor08; Jan 13th, 2007 at 07:23 AM.

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