snasui.com ยินดีต้อนรับ ยินดีต้อนรับสู่กระดานถามตอบ Excel and VBA และอื่น ๆ ที่เป็นมิตรกับทุกท่าน มีไฟล์แนบมหาศาล ช่วยให้ท่านค้นหาและติดตามศึกษาได้โดยง่าย สมาชิกท่านใดที่ยังไม่ได้ระบุ Version ของ Excel ที่ใช้งานจริง สามารถทำตาม Link นี้เพื่อจะได้รับคำตอบที่ตรงกับ Version ของท่านครับ ระบุ Version ของ Excel
Private Sub ListBox1_Click()
Dim say, lastrow As Long, a As Byte, i As Integer
On Error Resume Next
i = Me.ListBox1.ListIndex
If Me.ListBox1.Selected(i) = True Then
Sheets("Input").Range("M3").Value = Me.ListBox1.List(i, 0)
Sheets("Input").Range("C4").Value = Me.ListBox1.List(i, 1)
Sheets("Input").Range("E4").Value = Me.ListBox1.List(i, 2)
Sheets("Input").Range("E6").Value = Me.ListBox1.List(i, 3)
Sheets("Input").Range("C6").Value = Me.ListBox1.List(i, 4)
Sheets("Input").Range("C8").Value = Me.ListBox1.List(i, 5)
Sheets("Input").Range("C10").Value = Me.ListBox1.List(i, 6)
End If
lastrow = Sheets("Data").Cells(Rows.Count, "A").End(xlUp).Row
Sheets("Input").Activate
Sheets("Data").Range("A2:A" & lastrow).Find(What:=ListBox1.Value, LookIn:=xlValues, LookAt:=xlWhole).Activate
End Sub
You do not have the required permissions to view the files attached to this post.