1
저는 마스터 시트와 일일 시트가 있습니다. 일일 시트의 전자 메일 주소를 마스터 시트의 주소 (두 열 A)와 msgbox와 비교하고 싶습니다 마스터 시트에없는 임의의 목록, 문제는 내가에만 1 점까지 비교하지만, 메시지 상자 예를with excel vba는 두 개의 워크 시트 열을 비교하지만 첫 번째 점만
Master file Daily file
john.co.uk john.com
gim elephant.com
jeff.com.org jeff.co.com
scream.com scream
fish.cpl banana
result in msg box
elephant.com
banana
에 대한
에 전체 이메일 주소를 필요로 할 필요가있다
Dim C_ell As Range, Sh_D As Worksheet, Sh_M As Worksheet
Dim F_ound As Boolean, C_ell2 As Range
Set Sh_D = Sheets("") 'Set the active worksheet first
'Open Master workbook
On Error Resume Next
If IsError(Workbooks("")) Then
Workbooks.Open Filename:=ActiveWorkbook.Path & "\" & ""
Else
Workbooks("").Activate
End If
On Error GoTo 0
'Set the Master sheet for reference
Set Sh_M = Sheets("")
Sh_D.Activate
F_ound = False
For Each C_ell In Range("A1", Cells(Rows.Count, 1).End(xlUp))
Sh_M.Activate
For Each C_ell2 In Range("A1", Cells(Rows.Count, 1).End(xlUp))
If InStr(1, C_ell2, Left(C_ell, InStr(1, C_ell, ".", vbTextCompare)), vbTextCompare) <> 0 Then
F_ound = True
End If
Next
If Not F_ound Then
Cells(Rows.Count, 1).End(xlUp).Offset(1, 0) = C_ell
End If
F_ound = False
Next
h ope 의미가 있습니다
시도해 보셨습니까? –
이 내가 각 C_ell에서 범위 ("A1"셀 (Rows.count, 1) .END (xlUp)) 각 C_ell2에서 범위 Sh_M.Activate (들어 지금까지 F_ound = 거짓 을 시도한 것입니다 죄송합니다InStr (1, C_ell2, Left (C_ell, InStr (1, C_ell, ".", vbTextCompare)), vbTextCompare) <> 0 인 경우 "A1", Cells (Rows.count, 1) .End (xlUp) F_ound = 진정한 종료 다음 만약 그렇지 않은 경우 F_ound 그런 세포 (Rows.count, 1) .END (xlUp) .Offset (1, 0) = C_ell 끝 F_ound = 거짓 다음의 경우 – user3360439