Display/Show Column Headings In ListBox

  • Hy, i make a project with scada and i have a list box.
    In this list box i take the data from sql and go right but in my list box don't show column header's name.
    I want to see the column name of SQL.
    Can someone hel me?


    I show my code:


  • Re: Display/Show Column Headings In ListBox


    A ListBox will only display headings when the RowSource property is set to a range on a worksheet. The headings will be taken from the cells directly above the first row of RowSource.


    It is not possible to add headings to the ListBox using code.


    The only alternatives are to add labels above the listbox (Total PITA) or write the recordset to a worksheet (starting in row 2), use that as the Rowsource and then add the column names, using code, to the row above the list.

  • Re: Display/Show Column Headings In ListBox


    VBA controls, if you are using them, still have the same restrictions.


    This is an Excel forum, I cannot comment about SCADA or any native controls used by that application.

  • Re: Display/Show Column Headings In ListBox


    Quote

    adding in my code something i can show header column


    That was answered (in the context of an Excel environment) in my first reply. I can't imagine VBA based controls, if available in the environment you use, will have any extra functionality to that provided in Excel.


    I can't comment about other controls native to your environment, so sorry, I can't help further.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!