LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default VBA dynamically change width listbox

Thanks for your thinking with me anyway!

--
met vriendelijke groetjes


"JLGWhiz" schreef in bericht
...
Glad you found a solution. I had assumed that the code was in the
initialize
event. I should have followed my own rule and never assume anything.

"Frederik" wrote:

Problem solved!
I moved the procedure to change the width of the listbox to the procedure
accompagning userform2

public sub userform_activate()
userform2.listbox2.width = atl*158/31+5
end sub

and defined the variable atl as a public variable in my first module

--
met vriendelijke groetjes


"Frederik" schreef in bericht
...
Supplementary information:

If I put a Msgbox instruction in the code to display whatever message,
then the width of the listbox ís changed!
Strange ...
But I don't want that message on screen...

--
met vriendelijke groetjes


"Frederik" schreef in bericht
...
Using Windows XP Eccel 2003

On a UserForm there are only one ListBox and one OK button.
I would like to change the width of the UserForm, the width of the
ListBox and the position of the OK button,
depending on the largest element in the ListBox (depending on the
variable atl).

I'm using this code:

UserForm2.Width = atl * 158 / 31 + 80
UserForm2.ListBox2.Width = atl * 158 / 31 + 5
UserForm2.OKknop.Left = atl * 158 / 31 + 25

When I use Show to activate UserForm2 , the width of the UserForm and
the
position of the OK button are changed, but not the width of the
ListBox!
Why not?

Any hint is very welcome!

--
met vriendelijke groetjes












 
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
VBA dynamically change width listbox JLGWhiz Excel Programming 0 January 22nd 09 05:00 PM
Change Cell Width WITHOUT changing Column width dww701 Excel Discussion (Misc queries) 1 January 12th 09 10:52 PM
Listbox - Width Benz Excel Programming 3 March 9th 07 04:48 PM
Dynamically populating a 14-column listbox theSquirrel Excel Programming 3 January 20th 07 10:10 PM
dynamically created listbox clem Excel Programming 3 September 26th 06 03:30 PM


All times are GMT +1. The time now is 12:24 PM.

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"