snasui.com ยินดีต้อนรับ ยินดีต้อนรับสู่กระดานถามตอบ Excel and VBA และอื่น ๆ ที่เป็นมิตรกับทุกท่าน มีไฟล์แนบมหาศาล ช่วยให้ท่านค้นหาและติดตามศึกษาได้โดยง่าย สมาชิกท่านใดที่ยังไม่ได้ระบุ Version ของ Excel ที่ใช้งานจริง สามารถทำตาม Link นี้เพื่อจะได้รับคำตอบที่ตรงกับ Version ของท่านครับ ระบุ Version ของ Excel
Private Sub CommandButton2_Click()
Dim r As Long, i As Integer, j As Integer, k As Integer
With Sheets("Database")
r = .Range("x" & Rows.Count).End(xlUp).Row + 1
.Cells(r, 24) = namejob.Value
k = 25
For i = 0 To ListBox1.ListCount - 1
For j = 0 To 9
.Cells(r, k) = ListBox1.List(i, j)
k = k + 1
Next j
Next i
End With
End Sub
You do not have the required permissions to view the files attached to this post.
Private Sub ListBox1_Click()
Dim x As Integer
For x = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(x) = True Then
ComboBox7.Text = ListBox1.list(x)
End If
Next x
For x = ListBox1.ListCount - 1 To 0 Step -1
If ListBox1.Selected(x) = True Then
ListBox1.RemoveItem (x)
End If
Next x
End Sub
Private Sub ListBox1_Click()
Dim x As Integer
For x = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(x) = True Then
ComboBox7.Text = ListBox1.list(x)
End If
Next x
For x = ListBox1.ListCount - 1 To 0 Step -1
If ListBox1.Selected(x) = True Then
ListBox1.RemoveItem (x)
End If
Next x
End Sub
You do not have the required permissions to view the files attached to this post.
Dim isUpdated As Boolean
Private Sub ComboBox7_Change()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Database")
ws.Cells(127, 135).Value = Me.ComboBox7.Value
isUpdated = True
End Sub
Private Sub CommandButton1_Click()
Dim i As Integer, j As Integer
'ListBox1.RowSource = "Database!ED52:ED71"
With Sheets("Database")
For i = 52 To 71
If .Cells(i, "ed").Value <> "" Then
Me.ListBox1.AddItem .Cells(i, "ed").Value
End If
j = j + 1
Next i
End With
isUpdated = False
End Sub
Private Sub ListBox1_Click()
Dim x As Integer
If isUpdated Then
isUpdated = False
Exit Sub
End If
For x = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(x) = True Then
ComboBox7.Text = ListBox1.List(x)
Exit For
End If
Next x
For x = ListBox1.ListCount - 1 To 0 Step -1
If ListBox1.Selected(x) Then
ListBox1.RemoveItem (x)
End If
Next x
End Sub