Hai,
I have a userform which is driving me crazy. It has a ListBox with a bunch of items and next to it labels that give info about the listbox items but they do not alight properly when I have too many items. I can't figure out how to tie them together or at least make it look like so:
Couple of items look just fine: https://ibb.co/znkHpNN
But a lot of items don't align anymore: https://ibb.co/cDywFnY
This is the part of the code I used for labels but it seems when I use decimal places for .Top property it doesn't do what I need. For example 4.2 adds more spacing than 4.5, any idea why?
I have a userform which is driving me crazy. It has a ListBox with a bunch of items and next to it labels that give info about the listbox items but they do not alight properly when I have too many items. I can't figure out how to tie them together or at least make it look like so:
Couple of items look just fine: https://ibb.co/znkHpNN
But a lot of items don't align anymore: https://ibb.co/cDywFnY
This is the part of the code I used for labels but it seems when I use decimal places for .Top property it doesn't do what I need. For example 4.2 adds more spacing than 4.5, any idea why?
Code:
With textUSD
.Name = "USD" & i
.Caption = Format(Round(wb.Sheets(1).Cells(i + 1, 1).Value, 2), "standard")
.TextAlign = fmTextAlignCenter
[B] .Top = 4.5 + j[/B]
.Left = -5
End With
With checks
.Name = "Check" & i
.Caption = wb.Sheets(1).Cells(i + 1, 2).Value
.Font.Name = "Wingdings 2"
.Font.Charset = 2
.Font.Size = 11
If .Caption = "O" Then .ForeColor = RGB(255, 0, 0) Else .ForeColor = RGB(0, 176, 80)
.TextAlign = fmTextAlignCenter
[B] .Top = 4.5 + j[/B]
.Left = -18
End With
j = j + 9.5
Last edited: