Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
type mismatch on find function
I am getting a type mismatch on this Dim intResult As Integer intResult = Range("a:a").Find(What:="abc", After:="A44", LookIn:=xlValues,_ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,_ MatchCase:=False, SearchFormat:=False).Row I have also tried intResult = Cells.Find(What:="abc", After:="A44", ...).Row intResult = Selection.Find(What:="abc", After:="A44", ...).Row |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
type mismatch on find function
Dim rResult As Range SET rResult = Range("a:a").Find( etc etc "Scooter" wrote in message ... I am getting a type mismatch on this Dim intResult As Integer intResult = Range("a:a").Find(What:="abc", After:="A44", LookIn:=xlValues,_ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,_ MatchCase:=False, SearchFormat:=False).Row I have also tried intResult = Cells.Find(What:="abc", After:="A44", ...).Row intResult = Selection.Find(What:="abc", After:="A44", ...).Row |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
type mismatch on find function
I get a "compile error: type mismatch" with your suggestion. If I take the ".row" off the end of the Find, I still get the "run time error 13: type mismatch" "Patrick Molloy" wrote: Dim rResult As Range SET rResult = Range("a:a").Find( etc etc "Scooter" wrote in message ... I am getting a type mismatch on this Dim intResult As Integer intResult = Range("a:a").Find(What:="abc", After:="A44", LookIn:=xlValues,_ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,_ MatchCase:=False, SearchFormat:=False).Row I have also tried intResult = Cells.Find(What:="abc", After:="A44", ...).Row intResult = Selection.Find(What:="abc", After:="A44", ...).Row |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
type mismatch on find function
The "After" argument needs to be an actual Range value, not a String value. Use this for it... After:=Range("A44") -- Rick (MVP - Excel) "Scooter" wrote in message ... I am getting a type mismatch on this Dim intResult As Integer intResult = Range("a:a").Find(What:="abc", After:="A44", LookIn:=xlValues,_ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,_ MatchCase:=False, SearchFormat:=False).Row I have also tried intResult = Cells.Find(What:="abc", After:="A44", ...).Row intResult = Selection.Find(What:="abc", After:="A44", ...).Row |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
type mismatch on find function
Dim rResult As Range SET rResult = Range("a:a").Find(What:="abc", After:=Range("A44") "Patrick Molloy" wrote in message ... Dim rResult As Range SET rResult = Range("a:a").Find( etc etc "Scooter" wrote in message ... I am getting a type mismatch on this Dim intResult As Integer intResult = Range("a:a").Find(What:="abc", After:="A44", LookIn:=xlValues,_ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,_ MatchCase:=False, SearchFormat:=False).Row I have also tried intResult = Cells.Find(What:="abc", After:="A44", ...).Row intResult = Selection.Find(What:="abc", After:="A44", ...).Row |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
type mismatch on find function
There is no need for the OP to do this given what the statement does. Look at the .Row property call at the end of his Find function call... he is picking off the Row from the cell that was found by the Find function. Of course, doing it this way will require the OP to have some error checking routine to trap the error that will be generated if the text he is searching for doesn't appear anywhere in Column A (the range he is searching). -- Rick (MVP - Excel) "Patrick Molloy" wrote in message ... Dim rResult As Range SET rResult = Range("a:a").Find( etc etc "Scooter" wrote in message ... I am getting a type mismatch on this Dim intResult As Integer intResult = Range("a:a").Find(What:="abc", After:="A44", LookIn:=xlValues,_ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,_ MatchCase:=False, SearchFormat:=False).Row I have also tried intResult = Cells.Find(What:="abc", After:="A44", ...).Row intResult = Selection.Find(What:="abc", After:="A44", ...).Row |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
type mismatch on find function
i missed off the last closed bracket SET rResult = Range("a:a").Find(What:="abc", After:=Range("A44") ) FIND returns a range object, hence the DIM as Range and we sue SET to assign the found object to it. "Patrick Molloy" wrote in message ... Dim rResult As Range SET rResult = Range("a:a").Find(What:="abc", After:=Range("A44") ) "Patrick Molloy" wrote in message ... Dim rResult As Range SET rResult = Range("a:a").Find( etc etc "Scooter" wrote in message ... I am getting a type mismatch on this Dim intResult As Integer intResult = Range("a:a").Find(What:="abc", After:="A44", LookIn:=xlValues,_ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,_ MatchCase:=False, SearchFormat:=False).Row I have also tried intResult = Cells.Find(What:="abc", After:="A44", ...).Row intResult = Selection.Find(What:="abc", After:="A44", ...).Row |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
type mismatch on find function
That did the trick. Thanks much. "Rick Rothstein" wrote: The "After" argument needs to be an actual Range value, not a String value. Use this for it... After:=Range("A44") -- Rick (MVP - Excel) "Scooter" wrote in message ... I am getting a type mismatch on this Dim intResult As Integer intResult = Range("a:a").Find(What:="abc", After:="A44", LookIn:=xlValues,_ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,_ MatchCase:=False, SearchFormat:=False).Row I have also tried intResult = Cells.Find(What:="abc", After:="A44", ...).Row intResult = Selection.Find(What:="abc", After:="A44", ...).Row |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Type mismatch error in Find method | Excel Programming | |||
FIND type mismatch error, but don't see it | Excel Worksheet Functions | |||
Type mismatch error on Find | Excel Programming | |||
Type Mismatch - Match function | Excel Programming | |||
Type mismatch in look up function | Excel Programming |