ich habe eine UF mit Listbox, nun fehlen mir noch 2cm, wie kann man die Listbox BREITER gestalten.
Habe eine 17 Bildschirm, "platz" ist vorhanden.
Hier mein Makro:
Private Sub UserForm_Initialize()
'--------------- für Bildschirmanpassung --------------------------------------
Dim hwndForm As Long, hwndMenu As Long
Dim intY, intLast, intNext As Integer
On Error Resume Next
With UFDatenbank
.StartUpPosition = 0
.Top = 0
.Left = 0
.Height = GetDeviceCaps(GetDC(0&), 8)
.Width = GetDeviceCaps(GetDC(0&), 10)
End With
ReleaseDC 0, GetDC(0&)
hwndForm = FindWindow(vbNullString, Me.Caption)
'------------ ab hier festgelegt, UF kann nicht verschoben werden ----------------
If hwndForm 0 Then
hwndMenu = GetSystemMenu(hwndForm, 0)
If hwndMenu 0 Then DeleteMenu hwndMenu, &HF010, &H0
End If
Label15 = Worksheets("Datenbank").Range("C2").Value
Label17 = Format(Worksheets("Datenbank").Range("A2").Value, ("dd.mm.yyyy"))
Dim lzeile As Long
Dim i As Integer, j As Integer
lzeile = Sheets(strSh).Cells(Sheets(strSh).Rows.Count, ersteSpalte).End(xlUp).Row
With ListBox11
.ColumnCount = 15 'Anzahl der Spalten 'Herr.Typ 1,5
.ColumnWidths = "0,9cm;2,5cm;2cm;1,5cm;2cm;2cm;2cm;2cm;2cm;" _
& "1,8cm;1,5cm;1,5cm;1,2cm;2cm;1,5cm"
'0,9cm;2,5cm;1,5cm;1,5cm;2cm;2cm"
.Clear
'Listbox füllen
.List = Range(Sheets(strSh).Cells(intstartzeile, ersteSpalte), _
Sheets(strSh).Cells(lzeile, ersteSpalte + 14)).Value
'Sheets(strSh).Cells(lzeile, ersteSpalte + dritteSpalte)).Value
For i = 0 To (lzeile - intstartzeile) 'Datumsspalte
' ListBox11.List(i, 2) = Format(ListBox11.List(i, 2), "#.00")
ListBox11.List(i, 2) = Format(ListBox11.List(i, 2), "dd.mm.yyyy")
Next i
For i = 0 To (lzeile - intstartzeile)
ListBox11.List(i, 3) = Format(ListBox11.List(i, 3), "### ###")
' Format(CDate(TListBox11.List(i, 3), "dd.mm.yyyy")
Next i
End With
End Sub
mfg walter