<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: 11 columns in listbox - AutoCAD-VBA in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/11-columns-in-listbox-autocad-vba/m-p/11705190#M1924</link>
    <description>&lt;P&gt;Hello &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14801"&gt;@Ed__Jobe&lt;/a&gt;.&lt;BR /&gt;Thanks for your answer. Maybe you have given me the solution but I do not catch it. Columncount works from 1 to 10 but it does not work from 11 or more. I need 15 columns in my Listbox. Can you give me a vba code to have 15 columns in my listbox?&lt;/P&gt;</description>
    <pubDate>Wed, 25 Jan 2023 17:01:05 GMT</pubDate>
    <dc:creator>Ray-Sync</dc:creator>
    <dc:date>2023-01-25T17:01:05Z</dc:date>
    <item>
      <title>11 columns in listbox - AutoCAD-VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/11-columns-in-listbox-autocad-vba/m-p/11703478#M1922</link>
      <description>&lt;P&gt;Hi everyone. I want to have 11 columns in my listbox. Can you help me?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jefer_ing_1-1674618608758.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1166736i75A445C47BA5C753/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jefer_ing_1-1674618608758.png" alt="jefer_ing_1-1674618608758.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jefer_ing_2-1674618627785.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1166737i2F59BD7BE2CD4B78/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jefer_ing_2-1674618627785.png" alt="jefer_ing_2-1674618627785.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 03:50:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/11-columns-in-listbox-autocad-vba/m-p/11703478#M1922</guid>
      <dc:creator>Ray-Sync</dc:creator>
      <dc:date>2023-01-25T03:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: 11 columns in listbox - AutoCAD-VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/11-columns-in-listbox-autocad-vba/m-p/11704908#M1923</link>
      <description>&lt;P&gt;You already have 11 columns when you set the ColumnCount property. The List property is used to set the contents of the List. In your sample, you are trying to set the list address of Row 0, Column 10 to an integer of 11. Note what help says:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;VBA Help wrote:&lt;BR /&gt;
&lt;P class="RL"&gt;&lt;STRONG&gt;Remarks&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class="T"&gt;The List property works with the &lt;STRONG&gt;ListCount&lt;/STRONG&gt; and &lt;STRONG&gt;ListIndex&lt;/STRONG&gt; properties.Use List to access list items. A list is a variant &lt;A&gt;array&lt;/A&gt;; each item in the list has a row number and a column number.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 15:30:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/11-columns-in-listbox-autocad-vba/m-p/11704908#M1923</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2023-01-25T15:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: 11 columns in listbox - AutoCAD-VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/11-columns-in-listbox-autocad-vba/m-p/11705190#M1924</link>
      <description>&lt;P&gt;Hello &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14801"&gt;@Ed__Jobe&lt;/a&gt;.&lt;BR /&gt;Thanks for your answer. Maybe you have given me the solution but I do not catch it. Columncount works from 1 to 10 but it does not work from 11 or more. I need 15 columns in my Listbox. Can you give me a vba code to have 15 columns in my listbox?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 17:01:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/11-columns-in-listbox-autocad-vba/m-p/11705190#M1924</guid>
      <dc:creator>Ray-Sync</dc:creator>
      <dc:date>2023-01-25T17:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: 11 columns in listbox - AutoCAD-VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/11-columns-in-listbox-autocad-vba/m-p/11705233#M1925</link>
      <description>&lt;P&gt;You can have 15 columns. See below. Remember that the column numbers are zero indexed. 0-14 = 15 columns. The ColumnCount property sets the number of columns, the List property sets the contents of the cell.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="listbox 15.png" style="width: 490px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1167129iE50D75D16E2F6B14/image-size/large?v=v2&amp;amp;px=999" role="button" title="listbox 15.png" alt="listbox 15.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Here's an example of setting the List property.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="visual-basic"&gt;Public Sub FillFileList()

    'fill ListFiles list box with file names in StrDir global var
    Dim strFileList() As String
    Dim strFileName As String
    Dim i As Integer
    
    i = 0
    ReDim strFileList(i)
    strFileName = Dir(strDir + "*.scr")
    While Not strFileName = ""
        ReDim Preserve strFileList(i)
        'store filename in array
        strFileList(i) = strFileName
        i = i + 1
        'get next filename
        strFileName = Dir()
    Wend
    ListFiles.List = strFileList
End Sub&lt;/LI-CODE&gt;
&lt;P&gt;So, your problem is with:&lt;/P&gt;
&lt;P&gt;.List(0,10) = 11&lt;/P&gt;
&lt;P&gt;You need to create an array with values to be assigned to the List method.&lt;/P&gt;
&lt;LI-CODE lang="visual-basic"&gt;Private Sub UserForm_Initialize()
    Dim strList(2, 2) As String
    strList(0, 0) = "Col 1"
    strList(0, 1) = "Col 2"
    strList(0, 2) = "Col 3"
    strList(1, 0) = "R1C1"
    strList(1, 1) = "R1C2"
    strList(1, 2) = "R1C3"
    With ListBox1
        .ColumnCount = 3
        .ColumnWidths = "0.5 in;0.5 in;0.5 in"
        .List = strList
    End With
End Sub&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 17:44:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/11-columns-in-listbox-autocad-vba/m-p/11705233#M1925</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2023-01-25T17:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: 11 columns in listbox - AutoCAD-VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/11-columns-in-listbox-autocad-vba/m-p/11705361#M1926</link>
      <description>&lt;P&gt;I'm going to try it.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 17:58:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/11-columns-in-listbox-autocad-vba/m-p/11705361#M1926</guid>
      <dc:creator>Ray-Sync</dc:creator>
      <dc:date>2023-01-25T17:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: 11 columns in listbox - AutoCAD-VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/11-columns-in-listbox-autocad-vba/m-p/11705404#M1927</link>
      <description>It works. Thank you.</description>
      <pubDate>Wed, 25 Jan 2023 18:13:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/11-columns-in-listbox-autocad-vba/m-p/11705404#M1927</guid>
      <dc:creator>Ray-Sync</dc:creator>
      <dc:date>2023-01-25T18:13:26Z</dc:date>
    </item>
  </channel>
</rss>

