Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 169
Default Listbox header inside VBA (Array("Head1", "Head2", ...)

Hi,
I would like to put a header into my ListBox but since the values inside the
ListBox are calculated inside VBA, what is the best way to proceed? I tried
to put ColumnHead = True but rowsource needs to be inside excel. Is there a
way to add value from rowsource inside VBA instead like?
Dim aHeaders as Variant
aHeaders = Array("Head1", "Head2", ...)
Me.ListBox1.RowSource = aHeaders
Actally, value are added as:
For i = 0 To 10
Me.ListBox1.AddItem fTableValue(i+1,1)
Me.ListBox1.List(i, 1) = fTableValue(i+1,2)
Next i
Maybe i = 0 could be the header.. but I cannot put these cells in gray...
Thanks a lot!
--
Alex St-Pierre
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 169
Default Listbox header inside VBA (Array("Head1", "Head2", ...)

It's like very limited! I found an interesting article about how to make it
using class.
http://groups.google.com/group/micro...819cefb752b6ef
I also have seen that you can reproduce a column head using ListView. In
this case, the Header is gray. I don't know if these method can be use in VBA?
Thanks!
--
Alex St-Pierre


"Gary Brown" wrote:

AFAIK, you can not add headers in vba. This can only be done if the
information is on a worksheet and you are using the RowSource property.
--
HTH,
Gary Brown

If this post was helpful to you, please select ''YES'' at the bottom of the
post.



"Alex St-Pierre" wrote:

Hi,
I would like to put a header into my ListBox but since the values inside the
ListBox are calculated inside VBA, what is the best way to proceed? I tried
to put ColumnHead = True but rowsource needs to be inside excel. Is there a
way to add value from rowsource inside VBA instead like?
Dim aHeaders as Variant
aHeaders = Array("Head1", "Head2", ...)
Me.ListBox1.RowSource = aHeaders
Actally, value are added as:
For i = 0 To 10
Me.ListBox1.AddItem fTableValue(i+1,1)
Me.ListBox1.List(i, 1) = fTableValue(i+1,2)
Next i
Maybe i = 0 could be the header.. but I cannot put these cells in gray...
Thanks a lot!
--
Alex St-Pierre

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
If changed array formula reduce ""\""\""\ - signs to #Missing, will it make ... Maria J-son[_2_] Excel Programming 2 March 5th 06 12:20 PM


All times are GMT +1. The time now is 07:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"