{"id":7365,"date":"2024-12-21T17:25:18","date_gmt":"2024-12-21T17:25:18","guid":{"rendered":"https:\/\/blog.ezworkapp.com\/index.php\/2024\/12\/21\/cach-bo-nhung-khoang-trang-dau-dong-trong-trong-excel\/"},"modified":"2024-12-21T17:25:18","modified_gmt":"2024-12-21T17:25:18","slug":"cach-bo-nhung-khoang-trang-dau-dong-trong-trong-excel","status":"publish","type":"post","link":"https:\/\/blog.ezworkapp.com\/index.php\/2024\/12\/21\/cach-bo-nhung-khoang-trang-dau-dong-trong-trong-excel\/","title":{"rendered":"C\u00e1ch b\u1ecf nh\u1eefng kho\u1ea3ng tr\u1eafng \u0111\u1ea7u d\u00f2ng trong trong Excel"},"content":{"rendered":"<div class=\"uk-panel uk-margin\" id=\"template-dQf5b79p#1\">\n<p style=\"text-align: justify\">\u0110\u00f4i khi c\u00f3 m\u1ed9t s\u1ed1 kho\u1ea3ng tr\u1eafng tr\u01b0\u1edbc chu\u1ed7i trong \u00f4, nh\u1eefng kho\u1ea3ng tr\u1eafng n\u00e0y \u0111\u01b0\u1ee3c g\u1ecdi l\u00e0 <strong>leading spaces<\/strong>. Th\u1eadt l\u00e0 kh\u00f3 \u0111\u1ec3 b\u1ecf leading spaces trong \u00f4 t\u1eebng c\u00e1i m\u1ed9t. Tr\u00ean th\u1ef1c t\u1ebf, c\u00f3 m\u1ed9t s\u1ed1 th\u1ee7 thu\u1eadt th\u00f4ng minh c\u00f3 th\u1ec3 gi\u00fap ta lo\u1ea1i b\u1ecf leading spaces trong \u00f4 m\u1ed9t c\u00e1ch thu\u1eadn ti\u1ec7n v\u00e0 nhanh ch\u00f3ng.<\/p>\n<p style=\"text-align: justify\">Gi\u1ea3 s\u1eed ch\u00fang ta d\u00e1n m\u1ed9t s\u1ed1 n\u1ed9i dung t\u1eeb Microsoft Word c\u00f3 ch\u1ee9a c\u00e1c kho\u1ea3ng tr\u1eafng, sau \u0111\u00f3 n\u00f3 s\u1ebd hi\u1ec3n th\u1ecb kho\u1ea3ng tr\u1eafng \u0111\u1ea7u d\u00f2ng trong m\u1ed7i \u00f4 nh\u01b0 th\u1ec3 hi\u1ec7n d\u01b0\u1edbi \u0111\u00e2y.<\/p>\n<p style=\"text-align: justify\"><img decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/blog.ezworkapp.com\/wp-content\/uploads\/2024\/12\/doc-remove-leading-spaces1.png\" title=\"doc-remove-leading-spaces1\"><\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_61 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<p class=\"ez-toc-title\">Xem nhanh<\/p>\n<p><label for=\"ez-toc-cssicon-toggle-item-6766f9fda11cc\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><\/span><\/span><\/label><\/p>\n<nav>\n<ul class=\"ez-toc-list ez-toc-list-level-1 \">\n<li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/blog.hocexcel.online\/cach-bo-nhung-khoang-trang-dau-dong-trong-trong-excel.html#Xoa_Leading_spaces_trong_o_bang_ham_Trim\" title=\"X\u00f3a Leading spaces trong \u00f4 b\u1eb1ng h\u00e0m Trim\">X\u00f3a Leading spaces trong \u00f4 b\u1eb1ng h\u00e0m Trim<\/a><\/li>\n<li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/blog.hocexcel.online\/cach-bo-nhung-khoang-trang-dau-dong-trong-trong-excel.html#Xoa_Leading_spaces_trong_cac_o_voi_VBA\" title=\"Xo\u00e1 Leading spaces trong c\u00e1c \u00f4 v\u1edbi VBA\">Xo\u00e1 Leading spaces trong c\u00e1c \u00f4 v\u1edbi VBA<\/a><\/li>\n<\/ul>\n<\/nav>\n<\/div>\n<h2 style=\"text-align: justify\"><span class=\"ez-toc-section\" id=\"Xoa_Leading_spaces_trong_o_bang_ham_Trim\"><\/span>X\u00f3a Leading spaces trong \u00f4 b\u1eb1ng h\u00e0m Trim<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify\">H\u00e0m Trim trong Microsoft Excel c\u00f3 th\u1ec3 lo\u1ea1i b\u1ecf t\u1ea5t c\u1ea3 c\u00e1c kh\u00f4ng gian kh\u1ecfi v\u0103n b\u1ea3n ngo\u1ea1i tr\u1eeb kho\u1ea3ng c\u00e1ch gi\u1eefa c\u00e1c t\u1eeb.<\/p>\n<p style=\"text-align: justify\">B\u01b0\u1edbc 1: Nh\u1eadp c\u00f4ng th\u1ee9c = TRIM (A1) v\u00e0o \u00f4 li\u1ec1n k\u1ec1 C1 v\u00e0 nh\u1ea5n ph\u00edm Enter.<\/p>\n<p style=\"text-align: justify\"><img decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/blog.ezworkapp.com\/wp-content\/uploads\/2024\/12\/doc-remove-leading-spaces2.png\" title=\"doc-remove-leading-spaces2\"><br \/>\nB\u01b0\u1edbc 2: Ch\u1ecdn \u00f4 C1 v\u00e0 k\u00e9o chu\u1ed9t \u0111\u1ec3 \u0111i\u1ec1n c\u00f4ng th\u1ee9c v\u00e0o v\u00f9ng c\u00f3 \u00f4 m\u00e0 b\u1ea1n mu\u1ed1n lo\u1ea1i b\u1ecf leading spaces. Xem h\u00ecnh sau:<\/p>\n<p style=\"text-align: justify\"><img decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/blog.ezworkapp.com\/wp-content\/uploads\/2024\/12\/doc-remove-leading-spaces3.png\" title=\"doc-remove-leading-spaces3\"><\/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-293.gif\" title=\"vba101_92019-nho-293\"><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-662.gif\" title=\"ex101_92019-nho-662\"><br \/>\n<\/a>\n<\/div>\n<\/div>\n<p style=\"text-align: justify\">Ph\u01b0\u01a1ng ph\u00e1p n\u00e0y kh\u00e1 d\u1ec5 d\u00e0ng n\u1ebfu b\u1ea1n ch\u1ec9 c\u1ea7n lo\u1ea1i b\u1ecf leading spaces trong c\u00e1c \u00f4 ti\u1ebfp gi\u00e1p trong m\u1ed9t h\u00e0ng ho\u1eb7c m\u1ed9t c\u1ed9t. Tuy nhi\u00ean, khi b\u1ea1n c\u1ea7n lo\u1ea1i b\u1ecf leading spaces trong m\u1ed9t ph\u1ea1m vi v\u1edbi nhi\u1ec1u h\u00e0ng v\u00e0 c\u1ed9t, b\u1ea1n ph\u1ea3i s\u1eed d\u1ee5ng h\u00e0m nhi\u1ec1u l\u1ea7n.<\/p>\n<h2 style=\"text-align: justify\"><span class=\"ez-toc-section\" id=\"Xoa_Leading_spaces_trong_cac_o_voi_VBA\"><\/span>Xo\u00e1 Leading spaces trong c\u00e1c \u00f4 v\u1edbi VBA<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify\">N\u1ebfu b\u1ea1n c\u00f3 kinh nghi\u1ec7m v\u1edbi Microsoft Excel, VBA macro l\u00e0 m\u1ed9t s\u1ef1 l\u1ef1a ch\u1ecdn t\u1ed1t h\u01a1n \u0111\u1ec3 lo\u1ea1i b\u1ecf leading spaces trong c\u00e1c \u00f4.\u00a0B\u01b0\u1edbc 1: Gi\u1eef ph\u00edm Alt + F11, v\u00e0 n\u00f3 s\u1ebd m\u1edf ra c\u1eeda s\u1ed5 Microsoft Visual Basic for Applications.<\/p>\n<p style=\"text-align: justify\">B\u01b0\u1edbc 2: Nh\u1ea5p v\u00e0o Insert&gt; Module, v\u00e0 d\u00e1n macro sau v\u00e0o c\u1eeda s\u1ed5 Module.<\/p>\n<p style=\"text-align: justify\">Ch\u01b0a bi\u1ebft c\u00e1ch s\u1eed d\u1ee5ng VBA? <a href=\"http:\/\/blog.ezworkapp.com\/cach-hien-developer-de-ghi-macro-hoac-viet-code-vba-trong-excel.html\" target=\"_blank\" rel=\"noopener noreferrer\">Click \u0111\u1ec3 tham kh\u1ea3o<\/a><\/p>\n<div class=\"line number1 index0 alt2\" style=\"text-align: justify\"><\/div>\n<\/p>\n<div class=\"oembed-gist\">View the code on <a href=\"https:\/\/gist.github.com\/ndthanh\/03604ccc0730ea00674895069e68006e\">Gist<\/a>.<\/div>\n<p style=\"text-align: justify\">B\u01b0\u1edbc 3: Nh\u1ea5n ph\u00edm F5 \u0111\u1ec3 ch\u1ea1y macro n\u00e0y. Trong h\u1ed9p tho\u1ea1i b\u1eadt l\u00ean, b\u1ea1n c\u1ea7n ch\u1ecdn m\u1ed9t ph\u1ea1m vi v\u1edbi kh\u00f4ng gian h\u00e0ng \u0111\u1ea7u m\u00e0 b\u1ea1n mu\u1ed1n x\u00f3a, v\u00e0 sau \u0111\u00f3 nh\u1ea5p v\u00e0o n\u00fat OK. Xem h\u00ecnh sau:<\/p>\n<p style=\"text-align: justify\"><img decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/blog.ezworkapp.com\/wp-content\/uploads\/2024\/12\/doc-remove-leading-spaces8.png\" title=\"doc-remove-leading-spaces8\"><\/p>\n<p style=\"text-align: justify\">Ta c\u00f3 k\u1ebft qu\u1ea3 sau:<\/p>\n<p style=\"text-align: justify\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-6212\" src=\"http:\/\/blog.ezworkapp.com\/wp-content\/uploads\/2024\/12\/excel-dialog-box-launcher-1-159.png\" width=\"481\" height=\"142\" title=\"excel-dialog-box-launcher-1-159\"><\/p>\n<p>\u0110\u1ebfn \u0111\u00e2y b\u1ea1n \u0111\u00e3 c\u00f3 th\u1ec3 b\u1eaft \u0111\u1ea7u t\u00ecm hi\u1ec3u\u00a0nh\u1eefng\u00a0\u0111i\u1ec1u th\u00fa v\u1ecb c\u1ee7a VBA \u0111\u01b0\u1ee3c r\u1ed3i. VBA\u00a0gi\u00fap \u00edch\u00a0r\u1ea5t nhi\u1ec1u trong c\u00f4ng vi\u1ec7c: gi\u00fap b\u1ea1n t\u0103ng t\u1ed1c trong qu\u00e1 tr\u00ecnh x\u1eed l\u00fd tr\u00ean Excel, gi\u00fap l\u1eadp c\u00e1c b\u00e1o c\u00e1o t\u1ef1 \u0111\u1ed9ng, \u0111i\u1ec1u khi\u1ec3n c\u00e1c ch\u01b0\u01a1ng tr\u00ecnh kh\u00e1c nh\u01b0 Word, Power Point, Outlook \u2026 gi\u00fap bi\u1ebfn file Excel c\u1ee7a b\u1ea1n tr\u1edf th\u00e0nh 1 ph\u1ea7n m\u1ec1m chuy\u00ean nghi\u1ec7p \u2026<\/p>\n<p>\u0110\u1ec3 c\u00f3 th\u1ec3 h\u1ecdc VBA m\u1ed9t c\u00e1ch \u0111\u1ea7y \u0111\u1ee7, c\u00f3 h\u1ec7 th\u1ed1ng, b\u1ea1n h\u00e3y tham gia kho\u00e1 h\u1ecdc\u00a0<a href=\"http:\/\/bit.ly\/2OAUBOg\">VBA101 \u2013 VBA c\u01a1 b\u1ea3n d\u00e0nh cho ng\u01b0\u1eddi m\u1edbi b\u1eaft \u0111\u1ea7u<\/a>\u00a0c\u1ee7a h\u1ec7 th\u1ed1ng H\u1ecdc Excel Online. Hi\u1ec7n nay h\u1ec7 th\u1ed1ng \u0111ang c\u00f3 nhi\u1ec1u \u01b0u \u0111\u00e3i khi b\u1ea1n \u0111\u0103ng k\u00fd kh\u00f3a h\u1ecdc n\u00e0y. Chi ti\u1ebft xem t\u1ea1i:<\/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=\"http:\/\/blog.ezworkapp.com\/wp-content\/uploads\/2024\/12\/vba101_92019-nho-293.gif\"><br \/>\n<\/a>\n<\/div>\n","protected":false},"author":1,"featured_media":7366,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-7365","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\/7365","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=7365"}],"version-history":[{"count":0,"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/posts\/7365\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/media\/7366"}],"wp:attachment":[{"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/media?parent=7365"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/categories?post=7365"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/tags?post=7365"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}