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

วิธีสร้างพื้นที่พิมพ์แบบไดนามิกใน Excel

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

การสร้างพื้นที่พิมพ์แบบไดนามิกใน Excel


ลูกศรสีฟ้าฟองขวา การสร้างพื้นที่พิมพ์แบบไดนามิกใน Excel

ดังภาพด้านล่างนี้สมมติว่าพื้นที่พิมพ์ปกติของคุณคือ A1: E5 แต่ข้อมูลช่วงอาจเพิ่มขึ้นจนถึงแถวที่ 10 และคอลัมน์ G คุณสามารถสร้างพื้นที่พิมพ์แบบไดนามิกได้โดยทำตามขั้นตอนต่อไปนี้

1. คุณต้องสร้างช่วงที่ตั้งชื่อแบบไดนามิกในตอนแรก คลิก สูตร > ชื่อผู้จัดการ. ดูภาพหน้าจอ:

2 ใน ชื่อผู้จัดการ ใหคลิกปุ the ม ใหม่ เพื่อเปิด ชื่อใหม่ กล่องโต้ตอบ และในกล่องโต้ตอบชื่อใหม่ให้ป้อน พิมพ์_พื้นที่_สูตร เข้าไปใน Name กล่องและป้อนสูตร =OFFSET($A$1,0,0,COUNTA($A$1:$A$10),COUNTA($A$1:$G$1)) เข้าไปใน อ้างถึง แล้วคลิกไฟล์ OK ปุ่ม. ดูภาพหน้าจอ:

หมายเหตุ: ในสูตร $ ก $ 10 และ $ G $ 1 หมายความว่าพื้นที่พิมพ์จะไม่ใหญ่เกินแถว 10 และคอลัมน์ G คุณสามารถเปลี่ยนได้ตามต้องการ

3. เมื่อมันกลับไปที่ ชื่อผู้จัดการ โปรดปิดมัน

4. เลือกช่วงที่มีข้อมูลที่คุณจะตั้งเป็นพื้นที่พิมพ์ (ในกรณีนี้เราเลือก A1: E5) จากนั้นคลิก เค้าโครงหน้ากระดาษ > พื้นที่พิมพ์ > ตั้งค่าพื้นที่พิมพ์. ดูภาพหน้าจอ:

5 คลิก สูตร > ชื่อผู้จัดการ เพื่อเปิด ชื่อผู้จัดการ กล่องโต้ตอบ

6 ใน ชื่อผู้จัดการ กล่องโต้ตอบเลือกไฟล์ พิมพ์_พื้นที่ ใน Name จากนั้นแทนที่สูตรเดิมด้วย = พิมพ์_พื้นที่_สูตร (ชื่อของช่วงไดนามิกที่คุณสร้างไว้ด้านบน) ในไฟล์ อ้างถึง จากนั้นคลิกที่ไฟล์ เพื่อบันทึกการเปลี่ยนแปลง สุดท้ายปิดไฟล์ ชื่อผู้จัดการ กล่องโต้ตอบ

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

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

🤖 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 (10)
Rated 5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
Plain and simple, I've tried it a dozen times, made adjustments and still doesn't work. It won't take the formula. It keeps reverting, which means its reading the formula as an error. Don't get it. The name of my sheet is Contract Invoice. I don't see where you put that in the formula. I've tried replacine the COUNTA with the name of the sheet, tried putting it before and after COUNTA, but still nothing. My email is obviously listed above. If anyone has any suggestions, I'll try them.
This comment was minimized by the moderator on the site
Hi John,
If you wanted a print area for all non-blank rows, you might have something like
=OFFSET('Contract Invoice'!$A$1:$S$1,0,0,MAX(IF('Contract Invoice'!$A$1:$A$1005<>"",ROW('Contract Invoice'!$A$1:$A$1005),0)))

or whatever you like. The sheet name in the formula shouldn't matter.

You'd then define this name (say =my_print_area) as above mentioned above and set the "scope" to the workbook.

Then define your Print_Area to link to this formula and set the Scope to "Contract Invoice".

Hope that helps.
This comment was minimized by the moderator on the site
This was the best solution to this problem I found, after hours of searching
Rated 5 out of 5
This comment was minimized by the moderator on the site
this is definitely super usefull. However, each time I close and reopen the file, the Print_Area name configuration is gone. So each time I have to go to Define Names, and say Print_Area = Print_Area_Formula. Someone else with the same issue?? Thx!
This comment was minimized by the moderator on the site
Yeah, this is the only problem, but it only seems to happen when you open the Page Layout settings. Otherwise, it seems to be fine.
This comment was minimized by the moderator on the site
Ca ne fonctionne pas. A chaque fois qu'on faire le gestionnaire de noms et qu'on rentre dedans, il a remplacé la formule par la zone area de départ
This comment was minimized by the moderator on the site
Hi, just one thing, is your formula dynamic?. Would this be better =OFFSET($A$1,0,0,COUNTA($A:$A),COUNTA($1:$1))?

Then when the pivot changes or cells or columns are added the formula does not need to change.
This comment was minimized by the moderator on the site
First of all, thanks a lot!


Secondly: you don't need to define two "names" in the Mame Manager. As a simpler alternative, just select some random cells and set the print area (on those random cells), then open the Name Manager: it will have the print_area already in: here you can replace the content with the formula you want.
This comment was minimized by the moderator on the site
hi
thank you, it is great.

is there any way to have a conditional reference for the offset? I mean use the offset from the first cell in column A that contains a letter A, or equal to number 3 or filled by the color yellow.

I tried the following formula but it doesn't work.

offset(indirect(CELL("address",INDEX(A:A,MATCH("A",A:A,0)))),0,1,COUNTA(Sheet1!$b+Sheet1!$b:$b),7)

thanks

Mike
This comment was minimized by the moderator on the site
Hello,Its useful &exciting.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations