เราสามารถ Split คอลัมน์ได้ 2 แบบ เช่นเดียวกับเครื่องมือ Text to Column นั่นคือ แบ่งแบบใช้ตัวคั่น (delimiter) กับแบบมีจำนวนอักขระชัดเจน ( number of character)
ต้องบอกก่อนว่า เทคนิคนี้เป็นเครื่องมือใน Microsoft Word แต่ผมไม่ใช่ผู้เชี่ยวชาญ Word ดังนั้น หากใครเห็นว่ามีวิธีที่ดีกว่าที่ผมแนะนำ ก็สามารถบอกมาเป็นวิทยาทานให้ผมและคนอื่นๆ ได้รู้ด้วยนะครับ
เอาล่ะ เกริ่นมามากแล้ว เพื่อไม่ให้เสียเวลา เราไปดูกันเลย เอาเป็นว่าวันนี้ inwexcel ขอพูดเรื่อง Word บ้างล่ะ 555
Mail Merge คืออะไร?
Mail Merge คือความสามารถหนึ่งของ Microsoft Word ที่สามารถดึงข้อมูลจาก Database ต่างๆ (รวมถึงข้อมูลใน Excel) ที่มีข้อมูลหลายๆ Record (บรรทัด) มาโปรยลงแบบฟอร์มที่ได้เตรียมเอาไว้ใน Microsoft Word ได้ ซึ่งเราสามารถเอามาประยุกต์ทำเรื่องต่างๆ ได้มากมาย โดยมี Concept ดังนี้
วิธีแก้ 3 ประเด็นนี้ จริงๆ แล้วบางอันทำใน Word ก็ได้ โดยการกำหนด Format ใน Field Code
แต่ส่วนตัวผมไม่ชอบวิธีนี้ เพราะขี้เกียจมาจำวิธีการกำหนด Format ใน Word อีก (แค่ Excel ก็มึนแล้ว) ดังนั้นผมจะแก้ปัญหาทุกอย่างใน Excel ให้จบเลย แล้วค่อยส่งมาที่ Word เพื่อแสดงผลอย่างเดียว
แต่ถ้าหากผมลองเปลี่ยน Number Format ใน Excel ให้เป็นแบบที่ต้องการ เช่น เป็นวันที่แบบเต็ม และราคามีจุดทศนิยม
เวลาเข้ามาคลิ๊ก Next / Previous ดูใน Word ก็ยังคงแสดงวันที่และเลขตามปกติอยู่ดี เพราะมันเอาค่าแบบ General ไปแสดงเท่านั้น (ถ้าลองเปลี่ยนค่าไปเลยมันจะเปลี่ยนตามแล้ว แต่ Format ไม่เปลี่ยนตาม)
ผมจะเตรียมให้ข้อมูลทุกอย่างใน Excel ให้อยู่ในรปแบบที่ผมต้องการโดยต้องเป็น Text ทั้งหมด แล้วค่อยส่งไปแสดงผลตรงๆใน Word โดยที่ใน Word ไม่ต้องมีการกำหนด Format อะไรอีกเลย
Key สำคัญคือต้องทำให้เป็น Text ให้หมด อะไรที่เดิมเป็นตัวเลขและวันที่ ผมจะใช้ฟังก์ชั่น TEXT มาช่วย เพื่อแปลงให้มันอยู่ในรูปแบบที่ผมต้องการเลย ซึ่งเราจะต้องรู้ว่าต้องระบุ Custom Format ยังไง
แต่ก็ไม่ใช่เรื่องยากอย่างที่คิด เพราะเราสามารถเลือก Standard Format แบบที่ต้องการก่อน แล้วค่อยไปเลือก Custom Format เพื่อดู Code ที่จะต้องใช้อีกทีก็ได้
นอกจากนี้ เรายังสามารถ Save ลักษณะการ Import นั้นๆ (Save Web Query) ไว้ใช้ภายหลังได้อีกด้วย โดยการกดที่ icon แผ่น disk ข้างๆ คำว่า Options… ซึ่งพอ Save แล้วเราสามารถเปิดใช้ภายหลังโดยการ Open Query File ที่ Save ไว้ในเมนู Open File ปกติเลย
การ import ข้อมูลที่อยู่ใน Access
การ import ข้อมูลที่อยู่ใน Access จริงๆ แล้วสามารถทำได้ 2 ที่ คือ From Access ตรงๆ และ From Other Sources –> From Microsoft Query แต่ผมว่าวิธีแรกง่ายกว่าครับ
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
Cookie
Duration
Description
cookielawinfo-checkbox-analytics
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional
11 months
The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy
11 months
The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.