Solved

How to use Windows like Search for files containing Text in vb

Posted on 2002-04-09
6
272 Views
Last Modified: 2010-05-02
How to use Windows like Search for files containing Text in vb
0
Comment
Question by:girishnayaks
6 Comments
 
LVL 44

Expert Comment

by:bruintje
Comment Utility
Hi Girishnayaks,

-open the VB Editor with ALT+F11
-then look for the thisworkbook icon on the left pane
-double click it
-paste the following code


Option Explicit
Public blnChanged As Boolean

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Excel.Range)
  If WorksheetFunction.IsText(Target.Value) And blnChanged = False Then
    blnChanged = True
    Target.Value = UCase(Target.Value)
  Else
    blnChanged = False
  End If
End Sub


-then close the VB Editor
-and type text anywhere in your sheet

HTH:O)Bruintje
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
Bruintje, your comment went to the wrong q :-)
CHeers
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
girishnayaks :
In VB, you can do this in several methods, but will probably not be as efficient as windows method...

You can scan all the folders, open the files in readonly mode, and verify if your search text is in this file.

The main problem is the recursivity of scanning the folders, as the VB dir() command does not support recursivity by it's design. You must either build some routine around it, or use the Scripting.Filesystemobject classes for example.

If you have any q to the different steps...

CHeers

 

0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 44

Expert Comment

by:bruintje
Comment Utility
yup indeed, and i don't get any updates, sorry for the confusion and thread polution
0
 

Author Comment

by:girishnayaks
Comment Utility
Thanks But Im Sure there are some API to do this ans there are find file API's. Please Help Me..
0
 
LVL 3

Accepted Solution

by:
sridhar_PJ earned 200 total points
Comment Utility
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now