Good Day Ma'am/Sir.
May I ask for help.
I cant find a way to display my Header Name in my worksheet in to my listbox un userform, even though i set to true the value of columnhead properties,
it only displays cell values.
I just want to also appear the header names in the listbox.
Here is the code(found it on youtube):
Here is the Screen Shot:
and also is it possible to change the aligntment of each column in listbox?
THANK YOU!
May I ask for help.
I cant find a way to display my Header Name in my worksheet in to my listbox un userform, even though i set to true the value of columnhead properties,
it only displays cell values.
I just want to also appear the header names in the listbox.
Here is the code(found it on youtube):
Code:
Private Sub UserForm_Initialize()
For i = 0 To 3
Me.ComboBox1.AddItem Format(Date, "YYYY") - i
Next i
Me.ComboBox1.Value = Format(Date, "YYYY")
End Sub
Private Sub ComboBox1_Change()
Me.ListBox1.Clear
For i = 0 To 11
A = Application.WorksheetFunction.EDate("1" & "/" & "January" & "/" & Me.ComboBox1.Value, i)
B = Application.WorksheetFunction.EoMonth("1" & "/" & "January" & "/" & Me.ComboBox1.Value, i)
Me.ListBox1.AddItem Format(A, "MMMM")
Me.ListBox1.List(ListBox1.ListCount - 1, 1) = Application.WorksheetFunction.SumIfs _
(Sheet1.Range("B:B"), Sheet1.Range("A:A"), _
">=" & A, Sheet1.Range("A:A"), "<=" & B)
Next i
End Sub
Here is the Screen Shot:
and also is it possible to change the aligntment of each column in listbox?
THANK YOU!
Last edited by a moderator: