Userform Bugginess

RockandGrohl

Well-known Member
Joined
Aug 1, 2018
Messages
790
Office Version
  1. 365
Platform
  1. Windows
Hi chaps

I have a userform which contains a couple listboxes within a frame, with buttons below and a JPG above, nothing major. However, every time I load it, the elements are misplaced - the listboxes overlap each other, etc. If I click and drag the Userform window around, it resolves itself.

But my listboxes have selection change code in them. If I select one item on one listbox, the other updates dynamically. When this happens, everything jumbles itself up again, and I have to jiggle the window to sort it out.

I've added this code as per Senor GPT, which hasn't really stopped the Userform window being comically large (which seems to be aonther bug entirely) - To solve THAT bug, I need to go into the actual Userform in the VBA window and press one of the handles to resize the userform, then it snaps back to its proper size. What a mess!!

VBA Code:
Dim originalWidth As Double
    originalWidth = Me.Width
    Me.Width = originalWidth + 10
    Me.Width = originalWidth
    Me.Repaint

I'm on office 365.


Anyone got any tricks up their sleeve? TBH This file has two Userforms and they both do this crap, but the one I'm talking about here is way worse for it.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Your profile still says 2010...

Which build are you on? There was one that had a load of userform problems, but that was a while ago.
Need to change that..

Version 2404 (Build 17531.20062)


I added a bit of code on Userform Initialize & ListBox Change events to wiggle the Userform left and then right one pixel, which seems to have solved one problem, in addition to manually setting the size of the Userform on initialize.
 
Upvote 0

Forum statistics

Threads
1,216,210
Messages
6,129,525
Members
449,515
Latest member
lukaderanged

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top