Sub main()
Dim mainWorkbook As Workbook: Set mainWorkbook = Workbooks("해시 계산.xlsm")
Dim mainSheet As Worksheet: Set mainSheet = Worksheets("main")
Dim dataSheet As Worksheet: Set dataSheet = Worksheets("data")
mainSheet.Activate
Dim readTargetCol As String: readTargetCol = mainSheet.Range("B2").value
Dim readTargetRow As Integer: readTargetRow = mainSheet.Range("B3").value
Dim totalDataCnt As Integer: totalDataCnt = mainSheet.Range("B4").value
Dim resultTargetCol As String: resultTargetCol = mainSheet.Range("B5").value
Dim tmp As String
Dim result As String
Dim resultTargetStart As Integer: resultTargetStart = mainSheet.Range("B6").value
dataSheet.Activate
For i = readTargetRow To totalDataCnt + readTargetRow - 1
Dim value As String: value = "'" & dataSheet.Range(readTargetCol & i).value
If value = "'" Then
GoTo CONTINUE1
End If
Dim emailList() As String: emailList = Split(value, ";")
For k = 0 To UBound(emailList)
tmp = emailList(k)
tmp = Split(tmp, "<")(1)
tmp = Split(tmp, ">")(0)
result = result & tmp & vbCrLf
Next
dataSheet.Range(resultTargetCol & resultTargetStart).value = result
CONTINUE1:
resultTargetStart = resultTargetStart + 1
result = ""
tmp = ""
Next
End Sub
반응형
반응형