Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to find a string in a data? ASAP!!

Status
Not open for further replies.

syidah140484

Programmer
Feb 17, 2005
2
SG
hi pple..

i need help..

i 'm new in VBA.. so here goes the problem:

in my column J have a data that says: HelloMAY
how do i search for the word 'Hello'in this data on vba.. and i need to return the result in column K..
the result should be the position of the word 'Hello'

e.g of a result:

column J column K
HelloMAY 1

thanks.
 
Well, perhaps you can show us what you have tryed to far? Apart from using the search button on these forums (who on it's own should return you some results), pressing F1 on your VBA window should also allow you to search for a few keywords.



Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
And why do you need VBA for what can be done with a simple formula?

If you're new to VBA you can learn a lot by recording macros. Go to Tools > Macros > Record New Macro, do whatever you want in Excel, then Stop Recording and look at the resultant code.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Hi syidah140484,

In vba, you could use the InStr Function to test for the presence of one string within another - see the vba help. Then, to set a value in the adjacent column, you could use the Offset and Value properties - again, see the vba help.

As Tony points out, though, you can achieve the same result with a simple formula.

Cheers

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top