Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 50
Default Find specific info using search string using VBA

An order number is embedded in an email title, e.g., order number in the
email below is 09-11111
09-11111 for Customer Jones
The order number is not in the same location in each email title.

I am comparing two worksheets to determine the order numbers which do not
have corresponding emails.

The following works to locate the order number above:
Set C = .Find(ReqNum, LookIn:=xlValues)

Unfortunately, order numbers have revisions, e.g., 09-11111_2 and
09-11111_3, etc.

The find method searches within a string and finds 09-11111 when it comes
across an email title containing 09-11111_2. I need it to find the extract
string, e.g., 09-11111 and NOT within a revised order number such as
09-11111_2.

=========
Example:
Find 09-11111

This confirms your orders, 09-11111_2 (should not find 09-11111 in this
example)
09-11111 for Customer Jones (SHOULD find 09-11111 in this example)
==========

Any help would be GREATLY appreciated.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 50
Default Find specific info using search string using VBA

THIS IS A DUPLICATE QUESTION. SORRY. WHEN I "POSTED", IT SAID SERVICE WAS
TEMPORARILY NOT AVAILABLE, SO I THOUGHT I HAD TO RECREATE THE QUESTION.



"laavista" wrote:

An order number is embedded in an email title, e.g., order number in the
email below is 09-11111
09-11111 for Customer Jones
The order number is not in the same location in each email title.

I am comparing two worksheets to determine the order numbers which do not
have corresponding emails.

The following works to locate the order number above:
Set C = .Find(ReqNum, LookIn:=xlValues)

Unfortunately, order numbers have revisions, e.g., 09-11111_2 and
09-11111_3, etc.

The find method searches within a string and finds 09-11111 when it comes
across an email title containing 09-11111_2. I need it to find the extract
string, e.g., 09-11111 and NOT within a revised order number such as
09-11111_2.

=========
Example:
Find 09-11111

This confirms your orders, 09-11111_2 (should not find 09-11111 in this
example)
09-11111 for Customer Jones (SHOULD find 09-11111 in this example)
==========

Any help would be GREATLY appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 694
Default Find specific info using search string using VBA

Hi:

You need to add a space after the code as in "09-11111 "

This could be done with

Set C = .Find(trim(ReqNum) & " ", LookIn:=xlValues)

There may be issues with the internet space code so you may need to do this:

Set C = .Find(trim(ReqNum) & chr(127), LookIn:=xlValues)

and then combine them.
--
Hope this helps
Martin Fishlock, www.nyfconsultants.com, Wolverhampton, UK
Please do not forget to rate this reply.


"laavista" wrote:

An order number is embedded in an email title, e.g., order number in the
email below is 09-11111
09-11111 for Customer Jones
The order number is not in the same location in each email title.

I am comparing two worksheets to determine the order numbers which do not
have corresponding emails.

The following works to locate the order number above:
Set C = .Find(ReqNum, LookIn:=xlValues)

Unfortunately, order numbers have revisions, e.g., 09-11111_2 and
09-11111_3, etc.

The find method searches within a string and finds 09-11111 when it comes
across an email title containing 09-11111_2. I need it to find the extract
string, e.g., 09-11111 and NOT within a revised order number such as
09-11111_2.

=========
Example:
Find 09-11111

This confirms your orders, 09-11111_2 (should not find 09-11111 in this
example)
09-11111 for Customer Jones (SHOULD find 09-11111 in this example)
==========

Any help would be GREATLY appreciated.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 50
Default Find specific info using search string using VBA

This worked great, except IF the order number is at the end of the email
title, e.g.,
"Order for Carrie Jones, 09-11111"
it did not find it as it was expecting a blank at the end. I'm thinking I
could try to figure out how to just go through and add a space at the end of
each email title.
Any other suggestions?

THANK YOU for your quick response. This was a great, easy suggestion. I am
having trouble seeing the trees for the forest.

Thanks again.


"Martin Fishlock" wrote:

Hi:

You need to add a space after the code as in "09-11111 "

This could be done with

Set C = .Find(trim(ReqNum) & " ", LookIn:=xlValues)

There may be issues with the internet space code so you may need to do this:

Set C = .Find(trim(ReqNum) & chr(127), LookIn:=xlValues)

and then combine them.
--
Hope this helps
Martin Fishlock, www.nyfconsultants.com, Wolverhampton, UK
Please do not forget to rate this reply.


"laavista" wrote:

An order number is embedded in an email title, e.g., order number in the
email below is 09-11111
09-11111 for Customer Jones
The order number is not in the same location in each email title.

I am comparing two worksheets to determine the order numbers which do not
have corresponding emails.

The following works to locate the order number above:
Set C = .Find(ReqNum, LookIn:=xlValues)

Unfortunately, order numbers have revisions, e.g., 09-11111_2 and
09-11111_3, etc.

The find method searches within a string and finds 09-11111 when it comes
across an email title containing 09-11111_2. I need it to find the extract
string, e.g., 09-11111 and NOT within a revised order number such as
09-11111_2.

=========
Example:
Find 09-11111

This confirms your orders, 09-11111_2 (should not find 09-11111 in this
example)
09-11111 for Customer Jones (SHOULD find 09-11111 in this example)
==========

Any help would be GREATLY appreciated.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 694
Default Find specific info using search string using VBA

It may be easier to add a spcae to the end of the line but then you have
problems with punctuation.

No easy solution.

--
Hope this helps
Martin Fishlock, www.nyfconsultants.com, Wolverhampton, UK
Please do not forget to rate this reply.


"laavista" wrote:

This worked great, except IF the order number is at the end of the email
title, e.g.,
"Order for Carrie Jones, 09-11111"
it did not find it as it was expecting a blank at the end. I'm thinking I
could try to figure out how to just go through and add a space at the end of
each email title.
Any other suggestions?

THANK YOU for your quick response. This was a great, easy suggestion. I am
having trouble seeing the trees for the forest.

Thanks again.


"Martin Fishlock" wrote:

Hi:

You need to add a space after the code as in "09-11111 "

This could be done with

Set C = .Find(trim(ReqNum) & " ", LookIn:=xlValues)

There may be issues with the internet space code so you may need to do this:

Set C = .Find(trim(ReqNum) & chr(127), LookIn:=xlValues)

and then combine them.
--
Hope this helps
Martin Fishlock, www.nyfconsultants.com, Wolverhampton, UK
Please do not forget to rate this reply.


"laavista" wrote:

An order number is embedded in an email title, e.g., order number in the
email below is 09-11111
09-11111 for Customer Jones
The order number is not in the same location in each email title.

I am comparing two worksheets to determine the order numbers which do not
have corresponding emails.

The following works to locate the order number above:
Set C = .Find(ReqNum, LookIn:=xlValues)

Unfortunately, order numbers have revisions, e.g., 09-11111_2 and
09-11111_3, etc.

The find method searches within a string and finds 09-11111 when it comes
across an email title containing 09-11111_2. I need it to find the extract
string, e.g., 09-11111 and NOT within a revised order number such as
09-11111_2.

=========
Example:
Find 09-11111

This confirms your orders, 09-11111_2 (should not find 09-11111 in this
example)
09-11111 for Customer Jones (SHOULD find 09-11111 in this example)
==========

Any help would be GREATLY appreciated.



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 50
Default Find specific info using search string using VBA

Thanks again for all your help!

"Martin Fishlock" wrote:

It may be easier to add a spcae to the end of the line but then you have
problems with punctuation.

No easy solution.

--
Hope this helps
Martin Fishlock, www.nyfconsultants.com, Wolverhampton, UK
Please do not forget to rate this reply.


"laavista" wrote:

This worked great, except IF the order number is at the end of the email
title, e.g.,
"Order for Carrie Jones, 09-11111"
it did not find it as it was expecting a blank at the end. I'm thinking I
could try to figure out how to just go through and add a space at the end of
each email title.
Any other suggestions?

THANK YOU for your quick response. This was a great, easy suggestion. I am
having trouble seeing the trees for the forest.

Thanks again.


"Martin Fishlock" wrote:

Hi:

You need to add a space after the code as in "09-11111 "

This could be done with

Set C = .Find(trim(ReqNum) & " ", LookIn:=xlValues)

There may be issues with the internet space code so you may need to do this:

Set C = .Find(trim(ReqNum) & chr(127), LookIn:=xlValues)

and then combine them.
--
Hope this helps
Martin Fishlock, www.nyfconsultants.com, Wolverhampton, UK
Please do not forget to rate this reply.


"laavista" wrote:

An order number is embedded in an email title, e.g., order number in the
email below is 09-11111
09-11111 for Customer Jones
The order number is not in the same location in each email title.

I am comparing two worksheets to determine the order numbers which do not
have corresponding emails.

The following works to locate the order number above:
Set C = .Find(ReqNum, LookIn:=xlValues)

Unfortunately, order numbers have revisions, e.g., 09-11111_2 and
09-11111_3, etc.

The find method searches within a string and finds 09-11111 when it comes
across an email title containing 09-11111_2. I need it to find the extract
string, e.g., 09-11111 and NOT within a revised order number such as
09-11111_2.

=========
Example:
Find 09-11111

This confirms your orders, 09-11111_2 (should not find 09-11111 in this
example)
09-11111 for Customer Jones (SHOULD find 09-11111 in this example)
==========

Any help would be GREATLY appreciated.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find specific info within a text string using VBA laavista Excel Discussion (Misc queries) 2 May 20th 09 06:37 PM
how we find specific word from string in excel and compaire it. Vishnu Excel Worksheet Functions 2 April 18th 09 07:51 AM
How to search Excel files based on a specific text string in VBA c Bob Excel Discussion (Misc queries) 1 March 6th 09 05:09 AM
Find a specific formatted string in a cell KCK Excel Worksheet Functions 1 April 16th 08 09:16 PM
Find specific value in a string Lost in Microbiology Excel Discussion (Misc queries) 8 May 16th 07 09:58 AM


All times are GMT +1. The time now is 10:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"