{"id":8185,"date":"2024-12-22T04:09:49","date_gmt":"2024-12-22T04:09:49","guid":{"rendered":"https:\/\/blog.ezworkapp.com\/index.php\/2024\/12\/22\/dao-chuoi-so-hoac-ki-tu-trong-excel-voi-vba\/"},"modified":"2024-12-22T04:09:49","modified_gmt":"2024-12-22T04:09:49","slug":"dao-chuoi-so-hoac-ki-tu-trong-excel-voi-vba","status":"publish","type":"post","link":"https:\/\/blog.ezworkapp.com\/index.php\/2024\/12\/22\/dao-chuoi-so-hoac-ki-tu-trong-excel-voi-vba\/","title":{"rendered":"\u0110\u1ea3o chu\u1ed7i s\u1ed1 ho\u1eb7c k\u00ed t\u1ef1 trong Excel v\u1edbi VBA"},"content":{"rendered":"<div class=\"uk-panel uk-margin\" id=\"template-dQf5b79p#1\">\n<p>H\u00f4m n\u1ecd c\u00f3 b\u1ea1n h\u1ecfi l\u00e0m th\u1ebf n\u00e0o \u0111\u1ec3 \u0111\u1ea3o \u0111\u01b0\u1ee3c \u201c123456\u201d th\u00e0nh \u201c654321\u201d. C\u00e1i n\u00e0y, nhanh nh\u1ea5t l\u00e0 s\u1eed d\u1ee5ng VBA nh\u01b0 sau:<\/p>\n<\/p>\n<div class=\"oembed-gist\">View the code on <a href=\"https:\/\/gist.github.com\/ndthanh\/51ae65589f6993535ce9a9a14ef100e8\">Gist<\/a>.<\/div>\n<p>L\u00e0m th\u1ebf n\u00e0o \u0111\u1ec3 s\u1eed d\u1ee5ng \u0111o\u1ea1n code n\u00e0y?<\/p>\n<ul>\n<li>B\u01b0\u1edbc 1: T\u1ea1i file Excel \u0111ang s\u1eed d\u1ee5ng, b\u1ea5m t\u1ed5 h\u1ee3p ph\u00edm t\u1eaft ALT + F11 \u0111\u1ec3 m\u1edf tr\u00ecnh so\u1ea1n th\u1ea3o VBA<\/li>\n<li>B\u01b0\u1edbc 2: Trong tr\u00ecnh so\u1ea1n th\u1ea3o VBA, b\u1ea5m <strong>View &gt; Project explorer<\/strong><\/li>\n<li>B\u01b0\u1edbc 3: Trong c\u1eeda s\u1ed5 Project explorer, b\u1ea5m chu\u1ed9t ph\u1ea3i r\u1ed3i ch\u1ecdn <strong>Insert &gt; Module<\/strong><\/li>\n<li>B\u01b0\u1edbc 4: D\u00e1n \u0111o\u1ea1n code ph\u00eda tr\u00ean v\u00e0o Module1 v\u1eeba \u0111\u01b0\u1ee3c t\u1ea1o ra<\/li>\n<\/ul>\n<p>B\u01b0\u1edbc 5: S\u1eed d\u1ee5ng h\u00e0m v\u1eeba m\u1edbi t\u1ea1o ra (h\u00e0m n\u00e0y g\u1ecdi l\u00e0 UDF \u2013 User defined function) tr\u00ean sheet nh\u01b0 sau, gi\u1ea3 s\u1eed d\u1eef li\u1ec7u c\u1ea7n \u0111\u1ea3o n\u1eb1m trong \u00f4 A1:<\/p>\n<p><strong>=Reversestr(A1)<\/strong><\/p>\n<p>\u0110\u1ec3 t\u1ef1 vi\u1ebft \u0111\u01b0\u1ee3c nh\u1eefng UDF nh\u01b0 th\u1ebf n\u00e0y, b\u1ea1n c\u00f3 th\u1ec3 tham kh\u1ea3o kho\u00e1 h\u1ecdc sau \u0111\u00e2y:<\/p>\n<p><a href=\"https:\/\/www.hocexcel.online\/vba101\">https:\/\/www.hocexcel.online\/vba101<\/a><\/p>\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=\"https:\/\/blog.hocexcel.online\/wp-content\/uploads\/2019\/09\/VBA101_92019-nho.gif\"><br \/>\n<\/a>\n<\/div>\n","protected":false},"author":1,"featured_media":8186,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-8185","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\/8185","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=8185"}],"version-history":[{"count":0,"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/posts\/8185\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/media\/8186"}],"wp:attachment":[{"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/media?parent=8185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/categories?post=8185"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/tags?post=8185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}