{"id":7507,"date":"2024-12-21T17:48:14","date_gmt":"2024-12-21T17:48:14","guid":{"rendered":"https:\/\/blog.ezworkapp.com\/index.php\/2024\/12\/21\/chi-lay-ra-so-trong-doan-text-bang-vba-trong-excel\/"},"modified":"2024-12-21T17:48:14","modified_gmt":"2024-12-21T17:48:14","slug":"chi-lay-ra-so-trong-doan-text-bang-vba-trong-excel","status":"publish","type":"post","link":"https:\/\/blog.ezworkapp.com\/index.php\/2024\/12\/21\/chi-lay-ra-so-trong-doan-text-bang-vba-trong-excel\/","title":{"rendered":"Ch\u1ec9 l\u1ea5y ra s\u1ed1 trong \u0111o\u1ea1n text b\u1eb1ng VBA trong Excel"},"content":{"rendered":"<div class=\"uk-panel uk-margin\" id=\"template-dQf5b79p#1\">\n<p>\u0110\u00f4i khi ch\u00fang ta c\u1ea7n ph\u1ea3i l\u1ea5y ra 1 c\u1ee5m s\u1ed1, ho\u1eb7c 1 s\u1ed1, c\u00f3 th\u1ec3 l\u00e0 s\u1ed1 t\u00e0i kho\u1ea3n ng\u00e2n h\u00e0ng, s\u1ed1 \u0111i\u1ec7n tho\u1ea1i, s\u1ed1 b\u1ea3o hi\u1ec3m x\u00e3 h\u1ed9i trong 1 \u0111o\u1ea1n text. Vi\u1ec7c l\u1ea5y ra nh\u1eefng s\u1ed1 n\u00e0y v\u1edbi s\u1ed1 l\u01b0\u1ee3ng r\u1ea5t l\u1edbn d\u1eef li\u1ec7u l\u00e0 kh\u00f4ng kh\u1ea3 thi v\u00ec v\u1eady, ch\u00fang ta c\u00f3 th\u1ec3 v\u1eadn d\u1ee5ng ki\u1ebfn th\u1ee9c \u0111\u00e3 h\u1ecdc trong <a href=\"https:\/\/hocexcel.online\/category\/4-vba-excel\" target=\"_blank\">kho\u00e1 h\u1ecdc VBA c\u1ee7a H\u1ecdc Excel Online<\/a> \u0111\u1ec3 gi\u1ea3i quy\u1ebft v\u1ea5n \u0111\u1ec1 n\u00e0y nh\u01b0 sau:<\/p>\n<p>C\u00e1ch s\u1eed d\u1ee5ng h\u00e0m lay_so nh\u01b0 sau:<\/p>\n<p><strong>=lay_so(A1)<\/strong><\/p>\n<p>K\u1ebft qu\u1ea3 \u00e1p d\u1ee5ng cho chu\u1ed7i:<\/p>\n<p><strong>RRP 90 AVE DE GAULLE 92800 PUTEAUX 0109781431-0149012126 ABC<\/strong><\/p>\n<p>l\u00e0<\/p>\n<p><strong>90 92800 0109781431 0149012126<\/strong><\/p>\n<p>N\u1ed9i dung c\u1ee7a h\u00e0m UDF l\u1ea5y s\u1ed1 n\u00e0y nh\u01b0 sau. \u0110\u1ec3 s\u1eed d\u1ee5ng h\u00e0m lay_so, b\u1ea1n c\u1ea7n copy code n\u00e0y v\u00e0o 1 module trong VBA Project.<\/p>\n<div class=\"code-block code-block-2\" style=\"margin: 8px 0;clear: both\">\n<div class=\"ad-inserterpro\">\n<a href=\"https:\/\/hocexcel.online\/course\/preview\/vba101-tu-dong-hoa-excel-voi-lap-trinh-vba-cho-nguoi-moi-bat-dau\"><br \/>\n<img decoding=\"async\" src=\"http:\/\/blog.ezworkapp.com\/wp-content\/uploads\/2024\/12\/vba101_92019-nho-301.gif\" title=\"vba101_92019-nho-301\"><br \/>\n<\/a>\n<\/div>\n<\/div>\n<div class=\"code-block code-block-1\" style=\"margin: 8px 0;clear: both\">\n<div class=\"ad-inserterpro\">\n<a href=\"https:\/\/hocexcel.online\/course\/preview\/ex101-excel-tu-co-ban-den-chuyen-gia-danh-cho-nguoi-di-lam\"><br \/>\n<img decoding=\"async\" src=\"http:\/\/blog.ezworkapp.com\/wp-content\/uploads\/2024\/12\/ex101_92019-nho-672.gif\" title=\"ex101_92019-nho-672\"><br \/>\n<\/a>\n<\/div>\n<\/div>\n<div class=\"oembed-gist\">View the code on <a href=\"https:\/\/gist.github.com\/ndthanh\/8d8516b8c187beac527fe2a272c610c7\">Gist<\/a>.<\/div>\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":"<div class=\"ad-inserterpro\">\n<a href=\"https:\/\/hocexcel.online\/course\/preview\/vba101-tu-dong-hoa-excel-voi-lap-trinh-vba-cho-nguoi-moi-bat-dau\"><br \/>\n<img decoding=\"async\" src=\"http:\/\/blog.ezworkapp.com\/wp-content\/uploads\/2024\/12\/vba101_92019-nho-301.gif\"><br \/>\n<\/a>\n<\/div>\n","protected":false},"author":1,"featured_media":7508,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-7507","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-excel-nang-cao"],"_links":{"self":[{"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/posts\/7507","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=7507"}],"version-history":[{"count":0,"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/posts\/7507\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/media\/7508"}],"wp:attachment":[{"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/media?parent=7507"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/categories?post=7507"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/tags?post=7507"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}