Live-Forum - Die aktuellen Beiträge
Anzeige
Archiv - Navigation
1172to1176
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Inhaltsverzeichnis

Verständnisfrage

Verständnisfrage
RainerK
Hallo,
habe für eine UserForm folgende Initialisierung.
Private Sub UserForm_Initialize()
Dim IntS As Integer
Dim wks As Worksheet
Set wks = Worksheets("BS")
With ListBox1
.Font.Size = 9
.ForeColor = RGB(0, 0, 255)
.ColumnCount = 11
.ColumnWidths = ("4,6cm;3,3cm;2,9cm;0;0;1,8cm;2,8cm;0;0;2cm;1cm")
.Clear
For IntS = 7 To wks.Range("IV4").End(xlToLeft).Column
If Cells(13, IntS) > "" Then
.AddItem wks.Cells(4, IntS) & " • " & wks.Cells(5, IntS)
'.List(.ListCount - 1, 1) = wks.Cells(5, IntS)
.List(.ListCount - 1, 1) = wks.Cells(9, IntS)
.List(.ListCount - 1, 2) = Format(wks.Cells(21, IntS), "#,##0.00")
.List(.ListCount - 1, 3) = Format(wks.Cells(23, IntS), "#,##0.00")
.List(.ListCount - 1, 4) = Format(wks.Cells(25, IntS), "#,##0.00")
.List(.ListCount - 1, 5) = Format(wks.Cells(26, IntS), "#,##0.00")
.List(.ListCount - 1, 6) = Format(wks.Cells(32, IntS), "#,##0.00")
.List(.ListCount - 1, 7) = Format(wks.Cells(33, IntS), "#,##0.00")
.List(.ListCount - 1, 8) = Format(wks.Cells(34, IntS), "#,##0.00")
.List(.ListCount - 1, 9) = Format(wks.Cells(35, IntS), "#,##0.00") & " €    "
End If
Next IntS
End With
End Sub
Mit Set wks müsste die UserForm doch von jedem beliebigen Tabellenblatt aus aufgerufen werden können oder habe ich irgendwo noch ein "wks" vergessen?
Leider klappt der Aufruf nur, wenn ich im Arbeitsblatt "BS" bin.
Gruß Rainer

2
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Benutzer
Anzeige
AW: Verständnisfrage
30.08.2010 13:41:27
Hajo_Zi
Hallo Rainer,
vielleicht hier

If Cells(13, IntS) > ""

es fehlt am Ende Set Wks=Nothing

AW: Verständnisfrage
30.08.2010 14:28:28
RainerK
Hallo Hajo,
danke, das war's gewesen.
Gruß Rainer
Anzeige

Links zu Excel-Dialogen

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige