Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / April 2008

Tip: Looking for answers? Try searching our database.

Listbox autosize?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Keith - 28 Apr 2008 20:25 GMT
I have a form named PickAMonth with a listbox control named lstMonthlyTabs.  
I am assigning an array to the List property which works fine, but the next
two lines cause errors...

 PickAMonth.lstMonthlyTabs.List = vaWksNames
 PickAMonth.lstMonthlyTabs.AutoSize True
 PickAMonth.AutoSize True

Tried them both with = or := to set the true value but I still get the
error: Method or data  member not found; the ".AutoSize" is highlited when
the error is produced.  This is a form created inside the VB editor (not the
forms toolbar from excel)  

I am running Office2003 using excel's VBA to control the form.
How do I automatically size my listbox and form to match the data size?

Signature

Regards,
John

JLGWhiz - 28 Apr 2008 21:27 GMT
The correct syntax for the AutoSize is :
myObject.AutoSize = True

However, it looks as though MS chose not to include the ListBox as one of
the objects that the AutoSize property would apply to.  You will have to use
Height and Width to size the ListBox.

> I have a form named PickAMonth with a listbox control named lstMonthlyTabs.  
> I am assigning an array to the List property which works fine, but the next
[quoted text clipped - 11 lines]
> I am running Office2003 using excel's VBA to control the form.
> How do I automatically size my listbox and form to match the data size?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.