Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2002-04-09
6
Medium Priority
?
285 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
ID: 6930565
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 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6930604
Bruintje, your comment went to the wrong q :-)
CHeers
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6930612
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 44

Expert Comment

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

Author Comment

by:girishnayaks
ID: 6932963
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 600 total points
ID: 6936250
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

916 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