Private Sub UserForm_Initialize()
Dim lsb As Worksheet
Set lsb = Sheets("臨時表")
X = lsb.[a65536].End(3).Row
With ListBox1
.ColumnCount = 7 ‘設(shè)置7列
.ColumnWidths = "30,70,70,70,70,70,50" ‘設(shè)置每列寬度
.ColumnHeads = True ‘是否有標(biāo)題表頭
.RowSource = lsb.Range("a2:g" & X).Address(External:=True) ‘設(shè)置內(nèi)容
End With
End Sub