我有5列电子邮件地址。每列的每个单元格包含1个电子邮件地址,每行的电子邮件域不重复。我只想找到包含" @ gmail.com"的电子邮件。并将该单元格的值复制到新列。
使用此功能只能检查1列 = IF(ISNUMBER(SEARCH(" @ gmail.com",T1)),T1,"&#34)
我需要它来检查所有5列并返回包含" @ gmail.com"
的单元格的值答案 0 :(得分:0)
如果您希望所有电子邮件地址都包含" @ gmail.com):
=IF(ISNUMBER(SEARCH("@gmail.com",T1)),T1,"")& IF(ISNUMBER(SEARCH("@gmail.com",T2)),T2,"") & IF(ISNUMBER(SEARCH("@gmail.com",T3)),T3,"") &
IF(ISNUMBER(SEARCH("@gmail.com",T4)),T4,"") &
IF(ISNUMBER(SEARCH("@gmail.com",T1)),T1,"")
答案 1 :(得分:0)
这样可行,但您需要将其调整到您的范围:
Option Explicit
Sub test()
Dim myRow As Range
Dim r As Range
Set myRow = Range("A1:C1")
Do While myRow.Resize(1, 1) <> ""
For Each r In myRow
If InStr(1, r, "@gmail.com") Then
myRow.Offset(0, 3).Resize(1, 1) = r.Value
Exit For
End If
Next r
Set myRow = myRow.Offset(1, 0)
Loop
End Sub