Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello all,
Here is my problem for this morning... i have a piece of code (see below) that will collect all names where there is a blank for there appointment time. Problem 1) == The collection only contains 3 names, although there are definatly 5 records in my spreadsheet with blank times (2 of them appear before a record with a time) ** How do i get it to display all entries with no time?? Problem 2) == The collection only shows the first name (column B) ** How do i get the collection to have the first name and the surname (column D)?? -----------------CODE----------------------------- Set doll = New Collection Set sng = Range("A1") On Error Resume Next For k = 2 To Cells(Rows.Count, "A").End(xlUp).Row If Cells(k, "AX").Value = "" Then doll.Add Cells(k, "B").Value, Cells (k, "B").Text End If Next k With timetable.ComboBox2 .AddItem ("") For Each w In doll .AddItem CStr(w) Next w End With --------------------CODE----------------------------- Thank you, Robert Couchman ) |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Robert
Problem 1) == The collection only contains 3 names, although there are definatly 5 records in my spreadsheet with blank times (2 of them appear before a record with a time) ** How do i get it to display all entries with no time?? It could be that the time cells only look blank, but aren't really - like if they have a space in them. It could also be that the first names are the same. Since your collection value and key value are the same, if you have duplicates, they won't be added to the collection. Key values must be unique. If this is the case, the resolution to problem 2 will probably resolve this problem. Problem 2) == The collection only shows the first name (column B) ** How do i get the collection to have the first name and the surname (column D)?? dollAdd Cells(k,"B").Value & " " & Cells(k,"C").Value, Cells(k,"B").Value & " " & Cells(k,"C").Value -- Dick Kusleika MVP - Excel www.dicks-clicks.com Post all replies to the newsgroup. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
fill combobox depending on selection from another combobox | Excel Discussion (Misc queries) | |||
combobox into another combobox | New Users to Excel | |||
COMBOBOX | New Users to Excel | |||
combobox value | Excel Programming | |||
ComboBox | Excel Programming |