Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Selec the column to add in a listbox

I have a list in a sheet with 20 columns and a use a listbox to check the
datas in this list, for exemple:
A B C D E
F....
Numb Name Tel state code e-mail Validation code

when i want check all the datas, i use the code below to add all the column
in the listbox
ListBox1.ColumnCount = 20
ListBox1.RowSource = "A4:T200"

But sometimes I need check just the datas in some columns, so what i want to
do is insert a commandButton that when the user press this buttom just apears
in the listbox the columns B, D and F. is it possible?

please someone can help?
thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Selec the column to add in a listbox

Ana Paula,

I think the easiest solution would be to play with the ColumnWidths
property. You can still load the entire database into the ListBox, but you
can just hide the columns that you don't want. For example, in a 3 column
listbox, doing this:

ListBox1.ColumnWidths = "0;;"

will hide the first column and set the widths of the remaining 2 to
automatic width.

This:

ListBox1.ColumnWidths = "100; 0;"

will set the width of the first column to 100 points, hide the second column
and the third one will use whatever room there is left.

Hope this makes sense.

--
Regards,

Juan Pablo González

"Ana Paula" wrote in message
...
I have a list in a sheet with 20 columns and a use a listbox to check the
datas in this list, for exemple:
A B C D E
F....
Numb Name Tel state code e-mail Validation code

when i want check all the datas, i use the code below to add all the
column
in the listbox
ListBox1.ColumnCount = 20
ListBox1.RowSource = "A4:T200"

But sometimes I need check just the datas in some columns, so what i want
to
do is insert a commandButton that when the user press this buttom just
apears
in the listbox the columns B, D and F. is it possible?

please someone can help?
thanks




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
How do I create multi choice selec drop down list in Excel please JillyB Excel Discussion (Misc queries) 7 March 3rd 08 09:41 PM
excel shuts down bringing up file having multiple worksheets selec nikos Excel Discussion (Misc queries) 0 October 5th 06 04:12 AM
Macro to capture cell value then use it for a relative range selec PZ Straube Excel Programming 8 June 13th 05 08:28 AM
A recorded Macro to hide certain selected columns hides non selec. Mlmotter Excel Programming 2 December 31st 04 02:56 PM
To have an entire row highlighted to some color if any cell in that row is selec Nick Excel Programming 1 January 19th 04 03:09 PM


All times are GMT +1. The time now is 09:13 PM.

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

About Us

"It's about Microsoft Excel"