LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default Find Row Using 3 ComboBoxes As Criteria

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find the last row using 2 to 20 criteria Minister Excel Worksheet Functions 8 August 11th 09 12:35 AM
EXCEL - Meet 2 criteria, then find next case of third criteria Elaine Excel Worksheet Functions 3 December 1st 08 10:43 PM
Where is "open/tools/find/find files that match these criteria"? PJ Excel Discussion (Misc queries) 2 November 14th 08 04:11 PM
Trying to find a max value with criteria slot guy Excel Worksheet Functions 1 March 11th 05 04:23 PM
Find with criteria Soniya Excel Programming 4 October 24th 04 12:22 AM


All times are GMT +1. The time now is 12:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"