Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 04-03-2019, 04:01 PM
p45cal's Avatar
p45cal p45cal is offline Type mismatch error Windows 10 Type mismatch error Office 2016
Expert
 
Join Date: Apr 2014
Posts: 947
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

I can't reproduce your error.
Attaching a workbook where this happens would be very useful to us.

While trying to make this go wrong, I did manage to get a type mismatch error, but on the line:
Set FoundCell = SearchRange.Find(What:=FindWhat,
in the circumstances that I passed a non-contiguous range such as:
Range("$A$1:$A$3,$A$5:$A$7,$A$9:$A$10,$C$1:$C$2")
where the line:
Set LastCell =
immediately above sets LastCell to be a cell which doesn't exist in any area in the non-contiguous range to be searched. In this picture, the yellow cell is what LastCell is set to, and the grey area is the area to be searched, so in the .Find statement, After:=LastCell is not a cell in any area.




So really, if you can attach a file, with the code that makes it throw an error, it would be best. I don't even know whether you're searching non-contiguous ranges or not.

I also seem to remember from some time back that .FindNext doesn't work very well with non-contiguous ranges and I found I had to use .Find all the time with the After:= parameter set each time.
Reply With Quote
 

Tags
type mismatch



Similar Threads
Thread Thread Starter Forum Replies Last Post
Type Mismatch when RibbonX applying crtx to Chart? Elinor Excel Programming 0 06-03-2016 06:45 AM
Type mismatch error Name mismatch b/n two columns hiruy Excel 1 12-18-2015 07:14 AM
VBA in Excel: Add a new Word Document on Template (Type Mismatch Error)) tinfanide Excel Programming 1 03-29-2012 09:10 AM
[Mismatch] Help needed!!!!!!!! rockfielder Word 3 08-25-2011 11:45 AM
Resolution mismatch Adforum PowerPoint 5 05-25-2011 12:24 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:44 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft