find a word in the email address

  • Thread starter Thread starter Rajesh Candamourty
  • Start date Start date
R

Rajesh Candamourty

Dear All,

I have an email address say - (e-mail address removed). while running a
code/query i want to gather all the emails with "@emberindustries.com"
seperately from the table - tableA. How do i do this?

Any help highly appreciated.
Thank you.
Raj.
 
Thank you Rick.
but i have a situation different. in my code, the email id
(e-mail address removed) is stored in a string cont. now i want to check
using an if statement whether cont has the email id with
"@emberindustries.com" or not. so that based on this check i would call a
function.

Thanks in advance.
Raj
 
Please help me, I am really tensed and nothing is working in my head right
now.
I tried -
If cont = "*" & "@emberindustries.com" Then
Call SenMailtoEmber
Else
Exit
End If
the condition does not get executed. Tell me where I am doing wrong.

Thanks.
Raj.
 
you need to use "like" not "="

Rick B


Rajesh Candamourty said:
Please help me, I am really tensed and nothing is working in my head right
now.
I tried -
If cont = "*" & "@emberindustries.com" Then
Call SenMailtoEmber
Else
Exit
End If
the condition does not get executed. Tell me where I am doing wrong.

Thanks.
Raj.


running
 
Rajesh said:
Please help me, I am really tensed and nothing is working in my head right
now.
I tried -
If cont = "*" & "@emberindustries.com" Then
Call SenMailtoEmber
Else
Exit
End If
the condition does not get executed. Tell me where I am doing wrong.

Thanks.
Raj.
Look at the InStr instruction in help.

This example uses the InStr function to return the position of the first
occurrence of one string within another.

Dim SearchString, SearchChar, MyPos
SearchString ="XXpXXpXXPXXP" ' String to search in.
SearchChar = "P" ' Search for "P".

' A textual comparison starting at position 4. Returns 6.
MyPos = Instr(4, SearchString, SearchChar, 1)

' A binary comparison starting at position 1. Returns 9.
MyPos = Instr(1, SearchString, SearchChar, 0)

' Comparison is binary by default (last argument is omitted).
MyPos = Instr(SearchString, SearchChar) ' Returns 9.

MyPos = Instr(1, SearchString, "W") ' Returns 0.

HTH
Ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top