Posts by dsil

    Re: Search for File with Wildcards and Partial Filename


    Hope I can hitch a ride on this thread:


    I've used Visual basic for searching filenames with a wildcard in Excel 2000. I succeeded with the following code:



    The location for ".lookin" is the same for all files. I cut out the long location for reading purposes. The filename is always the same, except for "DCS", which will vary for each file.


    This code isnt working in excel 2007 anymore, because the "With Application.FileSearch" function has been deprecated from excel 2007.


    I can't seem to find a suitable replacement for this code. Can anybody help?

    I'm working on a VB code where I use an autofilter. I want to clear a selection in a couple of columns, where the value in the autofilter = 1.


    This is the code:


    Sometimes there is no value = 1, which results in clearing row no.1 because this row was still selected for the autofilter.
    I'd like to be able to check if there are any visible cells, before I proceed with the clearing of the selection.


    I tried this:

    Code
    If Selection.RowHeight <> 0 Then Range("J2:J" & lRow1).SpecialCells(xlCellTypeVisible).Select
        Selection.ClearContents


    But this doesnt work, because row no.1 is still selected.


    Can I use an If then statement to check If there are any visible cells, then clear these, if not, resume next.


    Thanks in advance.