snasui.com ยินดีต้อนรับ ยินดีต้อนรับสู่กระดานถามตอบ Excel and VBA และอื่น ๆ ที่เป็นมิตรกับทุกท่าน มีไฟล์แนบมหาศาล ช่วยให้ท่านค้นหาและติดตามศึกษาได้โดยง่าย สมาชิกท่านใดที่ยังไม่ได้ระบุ Version ของ Excel ที่ใช้งานจริง สามารถทำตาม Link นี้เพื่อจะได้รับคำตอบที่ตรงกับ Version ของท่านครับ ระบุ Version ของ Excel
Hi Dear All,
I need to ask you VBA expert.
how can we select the columns then those columns will populate on ListBox.
I mean use mouse selecting those columns
I attached the template
Thanks
You do not have the required permissions to view the files attached to this post.
Sorry for inform you about VBA question, one of the rule of this forum is needed some code from yourself that try to solve this problem and have that code inside your example file.
Private Sub UserForm_Activate()
'On Error Resume Next
Dim rRange As Range, rList As Range, strRowSource As String
Set rRange = Application.InputBox(Prompt:="Please Select Range", _
Title:="Range Select", Type:=8)
With Sheets("Sheet1")
If .Range("l2") <> "" Then .Range("l2").CurrentRegion.ClearContents
rRange.Copy .Range("l2")
Set rList = .Range("l2").CurrentRegion
strRowSource = .Name & "!" & rList.Address(0, 0)
Me.ListBox1.RowSource = strRowSource
End With
End Sub