Results 1 to 9 of 9
  1. #1
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: instead to write value in cells... (2000 sr 1)

    Simply remove all code that writes something to a cell. See attached version.

    I removed the On Click procedure for the list box since that expected a list of files in the worksheet.
    Attached Files Attached Files

  2. #2
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    instead to write value in cells... (2000 sr 1)

    Note: the orginal script not is mine:-)
    I use this userform to "browsing" dir and sub dir...
    Now i want to insert a new column in listbox2 and for each items write in this new column the last data of modified file...

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: instead to write value in cells... (2000 sr 1)

    Sorry, you changed the question while I was posting a reply. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>

  4. #4
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: instead to write value in cells... (2000 sr 1)

    For Each F1 In FC
    For I = 1 To Me.ListBox2.ColumnCount - 1
    ListBox2.AddItem F1.Name
    ListBox2.AddItem Format((F1.DateLastModified), "dd/mm/yyyy")
    Next I
    Next

    In effect i have set the property of listbox =2 , now i want to fill the first column with F1.Name and second column with Format((F1.DateLastModified), "dd/mm/yyyy")....

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: instead to write value in cells... (2000 sr 1)

    That doesn't make sense. Try this:

    I = 0
    For Each F1 In FC
    ListBox2.AddItem F1.Name
    ListBox2.Column(1, I) = Format((F1.DateLastModified), "dd/mm/yyyy")
    I = I + 1
    Next F1

  6. #6
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: instead to write value in cells... (2000 sr 1)

    tKS..
    But for you wath is the best way to named column in this listbox:
    A 2 little label on the top of listbopx or make a header for each column via code?

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: instead to write value in cells... (2000 sr 1)

    The ColumnHeads property of a list box works only if the list box is populated from a range on a worksheet through its RowSource property. Since you want to populate the list box using code, you should use labels above the list box.

  8. #8
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: instead to write value in cells... (2000 sr 1)

    Project finished 80%... i hope... (But i know a waziard in this Lounge and He always follows me <img src=/S/whisper.gif border=0 alt=whisper width=29 height=17>
    Attched in userform3 is a sub INVIO_MODULI. (this is an arrabnged code)
    I want with this code to send only the files selected with click mose from listbox2.
    note: i have set in property of listbox2=frmmultiselected 1

  9. #9
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: instead to write value in cells... (2000 sr 1)

    I don't use outlook so can test. But can you do something like:


    <pre> Dim FileArr() As Variant
    Dim x As Integer
    Dim i As Integer
    'Add other dims ...

    'Create FileArr
    i = 0
    For x = 0 To Me.ListBox2.ListCount - 1
    If Me.ListBox2.Selected(x) Then
    ReDim Preserve FileArr(i)
    FileArr(i) = Me.ListBox2.List(x)
    i = i + 1
    End If
    Next

    'your other code

    'Read filearr...
    For x = 0 To i - 1
    .Attachments.Add Me.ListBox2.List(x)
    Next

    'The rest of your code</pre>


    Steve

Posting Permissions

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