Archive for the ‘Userforms and Controls’ Category.

Related Sheets Stack

In Previous Sheets Stack, I created a historical list of sheets visited on the right click menu for easier navigation. After reading the comments, I decided to change the whole approach. Now I show related sheets (which I define) in a userform.
Related Sheets
I'm dealing with inventory assemblies, so the relationship is already defined. [...]

Sizing Listbox Columns

In my DDoE Quick TTC utility, I split text out into separate listbox columns. That means the column widths are always changing. Jan Karel has a very nice write-up on autosizing listbox columns. Based on that, I wrote the below procedure. I used the hidden label technique that JKP suggested. Instead [...]

My own Euler problem

Hi everyone,
With all these Euler posts I thought, why not post my own?
Suppose the following:
I have a products table set up like this:
Code ProdName Price
0001 Product1 556.68
0002 Product2 977.41
0003 Product3 350.62
0004 Product4 509.16
0005 Product5 748.4
0006 Product6 802.96
(list goes on to as much as 5000 products)
And I want to show this table in a userform and give the user some filtering possibilities (lets say on the first two [...]

List Userform Hotkeys

I hate trying to figure out which hotkeys are available when I need to add a control to a userform, so I wrote a procedure to list them.

Sub ListHotKeys(uf As UserForm)
   
    Dim ctl As Control
    Dim aKeys() As String
    Dim sKey As String
    Dim i As Long, j As [...]

On-the-fly data entry form

Hi all,
So after Dicks (nice to read) Alive and Well , let's do some Excel/VBA stuff again.
I intend to get a bit of discussion on this one, so bear with me.
I'm currently developing an Excel workbook for a customer. One of the interesting things with this project is that it consists of multiple data tables, [...]

Showing An Array On A Form; Autosizing ColumnWidths Of A ListBox

Hi all,
For a project I needed a quick way to display the content of an array to the user. I didn't want to use a worksheet, but opted for a userform. The data I wanted to show was contained in an array. The array contained something like:

Description
Before
After

Cell Errors
100
10

Corrupt Names
1000
0

Unused styles
232
0

So I figured I'd put a [...]

Positioning a Userform Over a Cell

keepITcool has developed a method to position a userform over a specific range. Finding a range's screen coordinates is tricky. I usually resort to "close enough".
He says:
First I found a bug. Excel 97 thru 2007.
The VisibleRange of Pane 2 and 3 (in a 4 pane window) are inconsistent.
depending on the sequence in [...]

Time Picker

Sam Radakovitz said:
And that’s about everything this date picker can do in a nut shell. There are some enhancements I’d like to make, not sure if I’ll get to them though:
* Update it for Excel 2007 & create nice ribbon buttons
* Support for setting time, like [...]