Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hey Tom,
I tried that , unfortunately it didn't work Column B is formatted as date/time (mm/dd/yyyy h:mm AM/PM). CLng(CB2) errors out with that type mismatch error. Is there anything else I can try? On Wed, 19 Jul 2006 12:08:01 -0700, Tom Ogilvy wrote: That code should work. If it isn't you need to debug it and see why it isn't working. One problem could be that some of your columns where you need to match are numbers. Values in a combobox are always strings (even if they look like numbers). this could be your problem. In the example I set up and tested, the second column was a number, so I converted the cb2.value like this clng(cb2.value) = cell.offset(0,1).value you could also do cb2.value = cell.offset(0,2).Text as long as you don't have special formatting applied that doesn't appear in the combobox. this was taken from a userform where it was working very well: Private Sub CommandButton1_Click() For Each c In Range("ReceiptList").Columns(1).Cells If CB1.Value = c.Value _ And CLng(CB2.Value) = c.Offset(0, 1).Value _ And CB3.Value = c.Offset(0, 2).Value Then TB5.Value = c.Offset(0, 3).Value TB6.Value = c.Offset(0, 4).Value Exit Sub End If Next c End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find the last row using 2 to 20 criteria | Excel Worksheet Functions | |||
EXCEL - Meet 2 criteria, then find next case of third criteria | Excel Worksheet Functions | |||
Where is "open/tools/find/find files that match these criteria"? | Excel Discussion (Misc queries) | |||
Trying to find a max value with criteria | Excel Worksheet Functions | |||
Find with criteria | Excel Programming |