ไปยังเนื้อหาหลัก

วิธีพิมพ์แถวซ้ำ ๆ ที่ด้านล่างของทุกหน้าที่พิมพ์ใน Excel

ตามค่าเริ่มต้น Excel มีคุณลักษณะให้ผู้ใช้พิมพ์แถวซ้ำ ๆ ที่ด้านบน แต่ในบางกรณีคุณอาจต้องการพิมพ์แถวซ้ำ ๆ ที่ด้านล่างของหน้ายกเว้นที่ด้านบน บทความนี้จะแสดงเทคนิคเล็ก ๆ น้อย ๆ

พิมพ์แถวซ้ำ ๆ ที่ด้านล่างด้วยรหัส VBA


พิมพ์แถวซ้ำ ๆ ที่ด้านล่างด้วยรหัส VBA

คุณสามารถเรียกใช้โค้ด VBA ด้านล่างเพื่อแทรกแถวที่ระบุลงในส่วนท้ายของทุกหน้า จากนั้นคุณสามารถพิมพ์แถวนี้ซ้ำ ๆ ที่ด้านล่างของทุกหน้าที่พิมพ์ใน Excel

1 กด อื่น ๆ + F11 พร้อมกันเพื่อเปิดไฟล์ Microsoft Visual Basic สำหรับแอปพลิเคชัน หน้าต่าง

2 ใน Microsoft Visual Basic สำหรับแอปพลิเคชัน หน้าต่างโต้ตอบคลิก สิ่งที่ใส่เข้าไป > โมดูล. จากนั้นคัดลอกและวางโค้ด VBA ด้านล่างลงในหน้าต่างโมดูล

รหัส VBA: แทรกแถวที่ระบุลงในส่วนท้ายของทุกหน้าที่พิมพ์

Sub MyFooter()
	Dim xTxt As String
	Dim xAddress As String
	Dim xRg As Range
	Dim xCell As Range
	On Error Resume Next
	xAddress = ActiveWindow.RangeSelection.Address
	Set xRg  = Application.InputBox("Select the row you will insert repeatedly at the bottom:", "Kutools for Excel", xAddress, , , , , 8)
	If xRg Is Nothing Then Exit Sub
		For Each xCell In xRg
			xTxt = xTxt & xCell.Value & " "
		Next
		ActiveSheet.PageSetup.LeftFooter = xTxt
	End Sub

3 กด F5 กุญแจสำคัญในการเรียกใช้รหัส จากนั้นกล่องโต้ตอบ Kutools for Excel จะปรากฏขึ้นโปรดเลือกแถวที่คุณต้องการพิมพ์ซ้ำ ๆ ที่ด้านล่างของทุกหน้าที่พิมพ์จากนั้นคลิกปุ่ม OK ปุ่ม

ตอนนี้เนื้อหาแถวที่ระบุจะถูกเพิ่มลงในส่วนท้ายของทุกหน้าที่พิมพ์ในแผ่นงานปัจจุบัน คุณสามารถเริ่มพิมพ์เวิร์กชีตได้

หมายเหตุ: หากคุณต้องการพิมพ์เนื้อหาที่เลือกซ้ำ ๆ ที่ด้านล่างของแต่ละหน้าภายในสมุดงานทั้งหมดคุณสามารถใช้ฟังก์ชันส่วนท้ายเพื่อแทรกเนื้อหาลงในส่วนท้ายของแผ่นงานทั้งหมดได้


ทำซ้ำแถวหัวเรื่องในทุกแถวที่ n ใน Excel:

Kutools สำหรับ Excel's แทรกแถวชื่อเรื่อง ยูทิลิตี้สามารถ hep ให้คุณแทรกแถวหัวเรื่องได้อย่างรวดเร็วก่อนทุกแถวที่ n ในช่วงที่เลือกใน Excel ดังภาพด้านล่างที่แสดง
ดาวน์โหลดและทดลองใช้ทันที! (เส้นทางฟรี 30 วัน)

สุดยอดเครื่องมือเพิ่มผลผลิตในสำนักงาน

🤖 Kutools AI ผู้ช่วย: ปฏิวัติการวิเคราะห์ข้อมูลโดยยึดตาม: การดำเนินการที่ชาญฉลาด   |  สร้างรหัส  |  สร้างสูตรที่กำหนดเอง  |  วิเคราะห์ข้อมูลและสร้างแผนภูมิ  |  เรียกใช้ฟังก์ชัน Kutools...
คุณสมบัติยอดนิยม: ค้นหา เน้น หรือระบุรายการที่ซ้ำกัน   |  ลบแถวว่าง   |  รวมคอลัมน์หรือเซลล์โดยไม่สูญเสียข้อมูล   |   รอบโดยไม่มีสูตร ...
การค้นหาขั้นสูง: VLookup หลายเกณฑ์    VLookup หลายค่า  |   VLookup ข้ามหลายแผ่น   |   การค้นหาที่ไม่ชัดเจน ....
รายการแบบเลื่อนลงขั้นสูง: สร้างรายการแบบหล่นลงอย่างรวดเร็ว   |  รายการแบบหล่นลงขึ้นอยู่กับ   |  เลือกหลายรายการแบบหล่นลง ....
ผู้จัดการคอลัมน์: เพิ่มจำนวนคอลัมน์เฉพาะ  |  ย้ายคอลัมน์  |  สลับสถานะการมองเห็นของคอลัมน์ที่ซ่อนอยู่  |  เปรียบเทียบช่วงและคอลัมน์ ...
คุณสมบัติเด่น: กริดโฟกัส   |  มุมมองการออกแบบ   |   บาร์สูตรใหญ่    สมุดงานและตัวจัดการชีต   |  ห้องสมุดทรัพยากร (ข้อความอัตโนมัติ)   |  เลือกวันที่   |  รวมแผ่นงาน   |  เข้ารหัส/ถอดรหัสเซลล์    ส่งอีเมลตามรายการ   |  ซุปเปอร์ฟิลเตอร์   |   ตัวกรองพิเศษ (กรองตัวหนา/ตัวเอียง/ขีดทับ...) ...
ชุดเครื่องมือ 15 อันดับแรก12 ข้อความ เครื่องมือ (เพิ่มข้อความ, ลบอักขระ, ... )   |   50 + แผนภูมิ ประเภท (แผนภูมิ Gantt, ... )   |   40+ ใช้งานได้จริง สูตร (คำนวณอายุตามวันเกิด, ... )   |   19 การแทรก เครื่องมือ (ใส่ QR Code, แทรกรูปภาพจากเส้นทาง, ... )   |   12 การแปลง เครื่องมือ (ตัวเลขเป็นคำ, การแปลงสกุลเงิน, ... )   |   7 ผสานและแยก เครื่องมือ (แถวรวมขั้นสูง, แยกเซลล์, ... )   |   ... และอื่น ๆ

เพิ่มพูนทักษะ Excel ของคุณด้วย Kutools สำหรับ Excel และสัมผัสประสิทธิภาพอย่างที่ไม่เคยมีมาก่อน Kutools สำหรับ Excel เสนอคุณสมบัติขั้นสูงมากกว่า 300 รายการเพื่อเพิ่มประสิทธิภาพและประหยัดเวลา  คลิกที่นี่เพื่อรับคุณสมบัติที่คุณต้องการมากที่สุด...

รายละเอียด


แท็บ Office นำอินเทอร์เฟซแบบแท็บมาที่ Office และทำให้งานของคุณง่ายขึ้นมาก

  • เปิดใช้งานการแก้ไขและอ่านแบบแท็บใน Word, Excel, PowerPoint, ผู้จัดพิมพ์, Access, Visio และโครงการ
  • เปิดและสร้างเอกสารหลายรายการในแท็บใหม่ของหน้าต่างเดียวกันแทนที่จะเป็นในหน้าต่างใหม่
  • เพิ่มประสิทธิภาพการทำงานของคุณ 50% และลดการคลิกเมาส์หลายร้อยครั้งให้คุณทุกวัน!
Comments (11)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi,

I've been trying to use the above code but when I try to print te code it doesn't work. I followed all above steps and it doesn't give me any errors.
I'm using office 365. Any tips ?

Thanks in advance,
This comment was minimized by the moderator on the site
Hi Tim,
Hi, the selected row will be inserted into the page footer, you need to switch to the Page Layout view to check for the result. Thank you for your comment.
This comment was minimized by the moderator on the site
Hi,

When I start the macro and select the wished rows it doesn't work when I try to print. What can this be?
Using office 365.

Thanks,
This comment was minimized by the moderator on the site
Hi,
I am trying a few times but it's not working. Please advise.
This comment was minimized by the moderator on the site
Good day,
Thank you for your comment. Which Office version do you use?
This comment was minimized by the moderator on the site
If I may, I use Office365 but its not working. Have tried putting the view on Page Layout Mode to no avail. Hope you can help. Thanks.
This comment was minimized by the moderator on the site
Thank you So Muchhhh...
It helped me very much.
This comment was minimized by the moderator on the site
Thanks for sharing. is any possibility of VBA code to repeated footer same as with "print titles" option including lines and auto page number. if possible please help me.
This comment was minimized by the moderator on the site
Thanks for sharing the macro to repeat the rows at the bottom of the page. Can this Macro be modified to Repeat selected Rows with the format as well.. In the provided Macro only Values are repeated at the bottom of each page, I am looking forward to copy the format as well at the bottom of the page..
This comment was minimized by the moderator on the site
Thanks a lot. This macro serves my purpose, Thanks to the creator and the person who had shared Macro
This comment was minimized by the moderator on the site
Thanks for Macro sharing. It serves my purpose. Thanks a lot.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations