关于如何在列表框中显示列标题 [英] regarding how can show the columns title in the listbox

查看:985
本文介绍了关于如何在列表框中显示列标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的

良好的问候语

我想询问我怎么能在列表框userform中显示列头标题

i want to inquire about how can i show the columns head titles in the listbox userform

问候.............. 

regards.............. 

推荐答案

尝试使用VBA代码中的Initialize事件进行分配

Try the following to assign using the Initialize event in the VBA code

Private Sub UserForm_Initialize()

Private Sub UserForm_Initialize()

    Dim lstBoxSource As Variant     '对于阵列

   

    '转置行并分配给数组

    lstBoxSource = WorksheetFunction.Transpose(工作表("Sheet1")。范围("A1:H1"))

   

    '将数组分配给ListBox的List属性

    Me.ListBox1.List = lstBoxSource

   

   

End Sub

    Dim lstBoxSource As Variant     'For array
   
    'Transpose the row and assign to the array
    lstBoxSource = WorksheetFunction.Transpose(Worksheets("Sheet1").Range("A1:H1"))
   
    'Assign the array to the List property of the ListBox
    Me.ListBox1.List = lstBoxSource
   
   
End Sub


这篇关于关于如何在列表框中显示列标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆