{"id":11333,"date":"2025-01-15T02:36:19","date_gmt":"2025-01-15T02:36:19","guid":{"rendered":"https:\/\/blog.ezworkapp.com\/index.php\/2025\/01\/15\/xuat-dia-chi-email-tu-van-ban\/"},"modified":"2025-01-15T02:36:19","modified_gmt":"2025-01-15T02:36:19","slug":"xuat-dia-chi-email-tu-van-ban","status":"publish","type":"post","link":"https:\/\/blog.ezworkapp.com\/index.php\/2025\/01\/15\/xuat-dia-chi-email-tu-van-ban\/","title":{"rendered":"XU\u1ea4T \u0110\u1ecaA CH\u1ec8 EMAIL T\u1eea V\u0102N B\u1ea2N"},"content":{"rendered":"<div class=\"uk-panel uk-margin\" id=\"template-nJy84WMn#1\">\n<p>M\u1eb9o n\u00e0y mi\u00eau t\u1ea3 t\u00ednh n\u0103ng c\u1ee7a VBA \u2013 \u00a0t\u00ednh n\u0103ng n\u00e0y ch\u1ea5p nh\u1eadn chu\u1ed7i v\u0103n b\u1ea3n nh\u01b0 th\u00f4ng tin \u0111\u01b0\u1ee3c nh\u1eadp v\u00e0o, r\u1ed3i tr\u1ea3 v\u1ec1 \u0111\u1ecba ch\u1ec9 email \u0111\u1ea7u ti\u00ean \u0111\u01b0\u1ee3c t\u00ecm th\u1ea5y trong v\u0103n b\u1ea3n. H\u00ecnh \u1ea3nh d\u01b0\u1edbi \u0111\u00e2y cho th\u1ea5y t\u00ednh n\u0103ng n\u00e0y khi \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng. C\u00f4ng th\u1ee9c trong \u00f4 B2 l\u00e0:<\/p>\n<p>=ExtractEmailAddress(A2)<\/p>\n<p>N\u1ebfu \u0111\u1ecba ch\u1ec9 email kh\u00f4ng \u0111\u01b0\u1ee3c t\u00ecm th\u1ea5y, th\u00ec t\u00ednh n\u0103ng n\u00e0y tr\u1ea3 v\u1ec1 m\u1ed9t chu\u1ed7i r\u1ed7ng. \u0110\u1ed3ng th\u1eddi, xin h\u00e3y l\u01b0u \u00fd r\u1eb1ng n\u00f3 ch\u1ec9 xu\u1ea5t \u0111\u1ecba ch\u1ec9 email \u0111\u1ea7u ti\u00ean.<\/p>\n<p>T\u00ednh n\u0103ng n\u00e0y kh\u00f4ng tinh t\u1ebf cho l\u1eafm. N\u00f3 ch\u1ec9 b\u1eaft \u0111\u1ea7u v\u1edbi \u201ck\u00fd t\u1ef1 @\u201d m\u00e0 n\u00f3 t\u00ecm th\u1ea5y, v\u00e0 ki\u1ec3m tra c\u00e1c k\u00fd t\u1ef1 tr\u01b0\u1edbc v\u00e0 sau k\u00fd t\u1ef1 @.<\/p>\n<table style=\"width: 810px\">\n<tbody>\n<tr>\n<td style=\"width: 802px\">\n<pre>Function ExtractEmailAddress(s As String) As String\r\n    Dim AtSignLocation As Long\r\n    Dim i As Long\r\n    Dim TempStr As String\r\n    Const CharList As String = \"[A-Za-z0-9._-]\"\r\n    \r\n    <span style=\"color: #0000ff\">'Get location of the @<\/span>\r\n    AtSignLocation = InStr(s, \"@\")\r\n    If AtSignLocation = 0 Then\r\n        ExtractEmailAddress = \"\" 'not found\r\n    Else\r\n        TempStr = \"\"\r\n        <span style=\"color: #0000ff\">'Get 1st half of email address<\/span>\r\n        For i = AtSignLocation - 1 To 1 Step -1\r\n            If Mid(s, i, 1) Like CharList Then\r\n                TempStr = Mid(s, i, 1) &amp; TempStr\r\n            Else\r\n                Exit For\r\n            End If\r\n        Next i\r\n        If TempStr = \"\" Then Exit Function\r\n        <span style=\"color: #0000ff\">'get 2nd half<\/span>\r\n        TempStr = TempStr &amp; \"@\"\r\n        For i = AtSignLocation + 1 To Len(s)\r\n            If Mid(s, i, 1) Like CharList Then\r\n                TempStr = TempStr &amp; Mid(s, i, 1)\r\n            Else\r\n                Exit For\r\n            End If\r\n        Next i\r\n    End If\r\n    <span style=\"color: #0000ff\">'Remove trailing period if it exists<\/span>\r\n    If Right(TempStr, 1) = \".\" Then TempStr = _\r\n       Left(TempStr, Len(TempStr) - 1)\r\n    ExtractEmailAddress = TempStr\r\nEnd Function\r\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u00a0<br \/>\nNgo\u00e0i ra, b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng c\u00f4ng c\u1ee5 online c\u1ee7a H\u1ecdc Excel Online t\u1ea1i \u0111\u1ecba ch\u1ec9 sau: <a href=\"http:\/\/blog.ezworkapp.com\/loc-email\">https:\/\/blog.hocexcel.online\/loc-email<\/a><\/p>\n<pre><\/pre>\n<\/div>\n<div class=\"uk-panel uk-margin uk-width-xlarge\">\n<p>Click \u0111\u0103ng k\u00fd h\u1ecdc t\u1ea1i:<\/p>\n<p><a href=\"http:\/\/blog.ezworkapp.com\/khoa-hoc\" target=\"_blank\" rel=\"noopener\">T\u1ea5t c\u1ea3 kho\u00e1 h\u1ecdc\u00a0<span>\ud83d\udcd6<\/span><\/a><\/p>\n<p><a href=\"http:\/\/blog.ezworkapp.com\/huong-dan-kich-hoat-khoa-hoc-tai-hoc-excel-online.html\" target=\"_blank\" rel=\"noopener\">H\u01b0\u1edbng d\u1eabn k\u00edch ho\u1ea1t<\/a><\/p>\n<p>HKD H\u1ecdc Excel Online<br \/>S\u1ed1 \u0110K: 17A80048102<\/p>\n<\/div>\n<div class=\"uk-panel uk-text-small uk-margin uk-margin-remove-bottom uk-text-center\">\n<p>\u00a9  document.currentScript.insertAdjacentHTML(&#8216;afterend&#8217;, &#8221; + new Intl.DateTimeFormat(document.documentElement.lang, {year: &#8216;numeric&#8217;}).format() + &#8221;);  H\u1ecdc Excel Online. All rights reserved.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>M\u1eb9o n\u00e0y mi\u00eau t\u1ea3 t\u00ednh n\u0103ng c\u1ee7a VBA \u2013 \u00a0t\u00ednh n\u0103ng n\u00e0y ch\u1ea5p nh\u1eadn chu\u1ed7i..<\/p>\n","protected":false},"author":1,"featured_media":11334,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-11333","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-excel-co-ban"],"_links":{"self":[{"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/posts\/11333","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/comments?post=11333"}],"version-history":[{"count":0,"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/posts\/11333\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/media\/11334"}],"wp:attachment":[{"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/media?parent=11333"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/categories?post=11333"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/tags?post=11333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}