Solved

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

Posted on 2002-04-09
6
274 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 142

Expert Comment

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

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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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 200 total points
ID: 6936250
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
message box in access 4 46
how to know if my Checkbox is True in VB6.0? 9 53
Formula problem with Excel attachment 6 25
VB6 - Scroll Mouse wheel on Picturebox 13 42
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

816 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