Results 1 to 10 of 935

Thread: Windows 10 and Office Excel

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,521
    Rep Power
    10


    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.
    Code:
             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 
    Using the above example, we are left with just 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.
    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) ' 
    First the full range to be searched is set. ( drivers worksheet D4:E180 )
    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









    Last edited by DocAElstein; 02-22-2020 at 01:18 AM.

Similar Threads

  1. Tests and Notes on Range Referrencing
    By DocAElstein in forum Test Area
    Replies: 70
    Last Post: 02-20-2024, 01:54 AM
  2. Tests and Notes for EMail Threads
    By DocAElstein in forum Test Area
    Replies: 29
    Last Post: 11-15-2022, 04:39 PM
  3. Notes tests. Excel VBA Folder File Search
    By DocAElstein in forum Test Area
    Replies: 39
    Last Post: 03-20-2018, 04:09 PM
  4. Replies: 37
    Last Post: 02-28-2018, 12:22 AM
  5. Replies: 2
    Last Post: 12-04-2012, 02:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •