A similar macro is used as previously to color match entries in the two worksheets. The basic coding will not change.
But some notes on how the existing coding is working is useful to refresh and clarify what is being done.
In my manually produced worksheet, I have included the information as given in the Device manager properties ( https://imgur.com/74D8vLN , https://imgur.com/T5Jhcii ,
https://imgur.com/zTZgx9S , https://imgur.com/uO7qRrO
http://www.excelfox.com/forum/showth...ll=1#post12124 )
In the worksheet I have typed in the information as given in the full path and file name format, such as in this example :
C:\Windows\system32\DRIVERS\hidparse.sys
However, my coding separates just the file name.
Using the above example, we are left with just the file nameCode:Let FileNmeSrchFor = Right(CelVl, (Len(CelVl)) - (InStrRev(CelVl, "\", -1, vbBinaryCompare))) ' Determine the file name as that looking from the right as many characters as (the total character number) - (the position looking from the right of a "\") --- the characters count left over after the subtraction is equal to the character length of the file name
hidparse.sys
That file name is then searched for in the appropriate worksheet, drivers , in this case. This is done by trying to assign a range object variable, FndCel , to the cell found in a search of the appropriate range in the drivers worksheet.
These are the appropriate code lines.
First the full range to be searched is set. ( drivers worksheet D4:E180 )Code:Dim SrchRng As Range: Set SrchRng = Application.Range("=drivers!D4:drivers!E180") ' Dim FndCel As Range: Set FndCel = SrchRng.Find(what:=FileNmeSrchFor, After:=Application.Range("=drivers!D4"), LookAt:=xlPart, searchorder:=xlNext, MatchCase:=False) '
Then an attempt is made to find hidparse.sys ( which is in the variable FileNmeSrchFor )
Important to note is the argument LookAt:=xlPart If we had alternatively used LookAt:=xlWhole , then only a matched cell would be returned if a cell was found with exactly hidparse.sys in it. Using LookAt:=xlPart means that, for example, this would also be considered a match
xyxyxyxhidparse.sys.mui
Furthermore, the argument , MatchCase:=False , would allow a match to this
xyxyxyxhiDparse.SYS.mui
I am hoping the careful selection of the arguments will help me not miss out any possible matches. I would ,prefer to select a few extra than miss some. By inspection I can see easier if I have some falsely selected, than trying to find any that got missed.
( One thing to note however, is that this way will only attempt a single match. Any additional matches will not be revealed by this method).
A selection is made,
DeviceManagerSelection.JPG : https://imgur.com/oSGqABp
, and then the macro run.
The next few posts show the results
Bookmarks