Datepicker in a listbox/listview second column

Grand

Board Regular
Joined
May 11, 2017
Messages
52
Hi
Is possible to have a datepicker (or maybe just another control like button etc) in a listox or listvew control for every item? And if yes, how is that done.

Thanks for any hit/help.
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
16,286
In Developer Mode
1. Right Click on the listbox
2.Choose Properties
3. Choose List Style
4. Choose List Style Options
See if that is what you want.
Works with Userform and Activex Listbox
 

Grand

Board Regular
Joined
May 11, 2017
Messages
52
Hey, thanks for the quick reply. Yes, it is on a userform. The Option style gives a checkbox where itmes can be checked. I however, would like to add a date for each item in the list. I thoughtof a datepicker control but I am not sure how to add control to each item onfor example the second column of the lsitbox. Is that possible?
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
16,286
I do not have a DatePicker Control and have never used one.

The checkbox is not a column in the listbox.

So If you want dates entered into The Listbox you could use a script like this:
This script will put Todays date and 10 days into the future into the listbox.

Put this script in your UserForm
Code:
Private Sub UserForm_Initialize()
'Modified  10/1/2018  5:03:46 AM  EDT
Dim i As Long
    For i = -1 To 10
        ListBox1.AddItem DateAdd("d", i + 1, Date)
    Next
End Sub
 

Grand

Board Regular
Joined
May 11, 2017
Messages
52
Datepicker can be added; it is not a standard control.
What I exactly need is that for every item in the listbox a date can be entred. It could be other ways of doing it but I thought either a datepicker or just a textbox to enter a date manually. The date is going to be different for each item, is unique and can be one or many based on how many items are listed in the listbox. Is that possible?
 
Last edited:

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
16,286
Yes thanks. I know DatePicker can be added but I have not done so.

I'm not sure what your asking for.
Sounds to me like you want to add items to a ListBox and then in column 2 of the listbox you want some date entered.

What items are being added to the listbox column(1)?

What is your ultimate goal here?
After adding all theses value to column (1) of the listbox and then adding dates to column(2) of the listbox

What do you plan to do with this?
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,362
Office Version
365
Platform
Windows
You can't add a DatePicker to a listbox in VBA.

Why not use the listbox DblClick event to pop a datepicker and then add the selected date to the row that was double clicked.
 

Grand

Board Regular
Joined
May 11, 2017
Messages
52
Yes thanks. I know DatePicker can be added but I have not done so.

I'm not sure what your asking for.
Sounds to me like you want to add items to a ListBox and then in column 2 of the listbox you want some date entered.

What items are being added to the listbox column(1)?

What is your ultimate goal here?
After adding all theses value to column (1) of the listbox and then adding dates to column(2) of the listbox

What do you plan to do with this?
Sorry about being unclear. What you described is more and less what I want to be able to do. So my listbox is filled with some items (some data from an array I have) which are based on a values of a dropdown box. So far I could manage.
The next thing is to add an individual date for each item in that listbox.The info, that is the item list including date for each item, is then sent by email to a pedefined address.
 

Grand

Board Regular
Joined
May 11, 2017
Messages
52
You can't add a DatePicker to a listbox in VBA.

Why not use the listbox DblClick event to pop a datepicker and then add the selected date to the row that was double clicked.
Tha is actually a good idea. So my listbox will have two columns; column one is filled out with my data, column two is initilly empty. Uppon dobble-clicking on a specfic row a small user form pops-up in which I can place my famous datepicker. I think I will persue this path and see how far I can get.
 

Forum statistics

Threads
1,082,297
Messages
5,364,373
Members
400,793
Latest member
hamzayagiz

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top