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

วิธีวางค่าลงในเซลล์ที่มองเห็น / กรองเฉพาะใน Excel

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

วางค่าลงในเซลล์ที่มองเห็นได้ด้วย VBA

วางค่าลงในเซลล์ที่มองเห็นได้ด้วย Paste to Visible Range ของ Kutools for Excel ความคิดที่ดี 3


วางค่าลงในเซลล์ที่มองเห็นได้ด้วย VBA

ใน Excel ไม่มีวิธีอื่นในการแก้ปัญหานี้ยกเว้น VBA

1 กด Alt + F11 คีย์พร้อมกันและก Microsoft Visual Basic สำหรับแอปพลิเคชัน หน้าต่างปรากฏขึ้น

2 คลิก สิ่งที่ใส่เข้าไป > โมดูลจากนั้นวางโค้ด VBA ด้านล่างลงในหน้าต่าง popping Module

VBA: วางค่าลงในเซลล์ที่มองเห็นเท่านั้น

Sub CopyFilteredCells()
	'Updateby20150203
	Dim rng1 As Range
	Dim rng2 As Range
	Dim InputRng As Range
	Dim OutRng As Range
	xTitleId     = "KutoolsforExcel"
	Set InputRng = Application.Selection
	Set InputRng = Application.InputBox("Copy Range :", xTitleId, InputRng.Address, Type: = 8)
	Set OutRng   = Application.InputBox("Paste Range:", xTitleId, Type: = 8)
	For Each rng1 In InputRng
		rng1.Copy
		For Each rng2 In OutRng
			If rng2.EntireRow.RowHeight > 0 Then
				rng2.PasteSpecial
				Set OutRng = rng2.Offset(1).Resize(OutRng.Rows.Count)
				Exit For
			End If
		Next
	Next
	Application.CutCopyMode = False
End Sub

3 คลิก F5 คีย์หรือ วิ่ง จากนั้นกล่องโต้ตอบจะปรากฏขึ้นเพื่อให้คุณเลือกค่าที่จะคัดลอก ดูภาพหน้าจอ:
doc-paste-to-visible-cell-1

4. หลังจากเลือกค่าแล้วให้คลิก OKจากนั้นกล่องโต้ตอบอื่นจะปรากฏขึ้นเพื่อเลือกช่วงที่จะวางข้อมูลที่เลือก ดูภาพหน้าจอ:
doc-paste-to-visible-cell-2

5 คลิก OK. คุณสามารถเห็นเฉพาะเซลล์ที่มองเห็นได้เท่านั้นที่วางค่าที่เลือกไว้


วางค่าลงในเซลล์ที่มองเห็นได้ด้วย Paste to Visible Range ของ Kutools for Excel

จริงๆแล้วถ้าคุณใช้ วางในช่วงที่มองเห็นได้ ประโยชน์ของ Kutools สำหรับ Excel - เครื่องมือ Excel ที่มีประโยชน์คุณสามารถแก้ปัญหาการวางค่าในช่วงที่มองเห็นได้อย่างรวดเร็วและง่ายดาย
doc วางเซลล์ที่มองเห็นได้ 6

Kutools สำหรับ Excel, ที่มีมากกว่า 300 ฟังก์ชั่นที่มีประโยชน์ทำให้งานของคุณง่ายขึ้น 

หลังจากการติดตั้ง Kutools สำหรับ Excel โปรดทำดังนี้:(ดาวน์โหลด Kutools for Excel ฟรีทันที!)

1. เลือกช่วงของค่าที่คุณต้องการคัดลอกและวางจากนั้นคลิก Kutools > พิสัย > วางในช่วงที่มองเห็นได้ > ทั้งหมด or วางเฉพาะค่า. ดูภาพหน้าจอ:
doc วางเซลล์ที่มองเห็นได้ 7

2. จากนั้นก วางในช่วงที่มองเห็นได้ กล่องโต้ตอบจะปรากฏขึ้นและเลือกช่วงที่คุณต้องการวางค่า ดูภาพหน้าจอ:
doc วางเซลล์ที่มองเห็นได้ 8

3 คลิก OK. ตอนนี้ค่าที่เลือกจะถูกวางลงในช่วงที่มองเห็นได้เท่านั้น

วางเฉพาะค่าลงในเซลล์ที่มองเห็นได้ วางทั้งหมดลงในเซลล์ที่มองเห็นได้
doc วางเซลล์ที่มองเห็นได้ 9 doc วางเซลล์ที่มองเห็นได้ 10


หมายเหตุ
ยูทิลิตี้นี้ทำงานกับแถวหรือคอลัมน์ที่ซ่อนและกรอง

คลิกที่นี่เพื่อดูข้อมูลรายละเอียดเพิ่มเติมเกี่ยวกับยูทิลิตี้ Paste to Visible Range

  วางลงในเซลล์ที่มองเห็นได้เท่านั้น

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

🤖 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 (22)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Thank you very much hundred times
This comment was minimized by the moderator on the site
After going absolutely crazy trying to find a solution, this worked - specifically, the macro for pasting INTO visible only cells. Note that I was copying only from unfiltered cells. However, the people complaining that it doesn't do both (which I'm not sure is true) should be quiet because it's pretty easy to copy FROM only visible/filtered cells into an unfiltered area. You don't need a macro for that (and if you're trying to do both, just do the copying of filtered cells in Excel first, then use this macro). Again, what Excel is fully unable to do on its own without a macro is to paste to visible cells only. This macro saved my bum. Thanks!
This comment was minimized by the moderator on the site
Thanks for your recognition.
This comment was minimized by the moderator on the site
This worked perfectly, thanks!
This comment was minimized by the moderator on the site
You can also easily do this without a plugin....
CTRL+C the cells you want to paste
Highlight the filtered/partially hidden range you're pasting to
CTRL+G
Select "Special"
Select "Visible Cells Only" & hit OK
CTRL+V
This comment was minimized by the moderator on the site
Thansk for you reply, but it does not work. With your method, it paste all cells including hidden ones with the copied values.
This comment was minimized by the moderator on the site
VBA method did not work! It copied the invisible cells into the visible cells. Now, I realize that the title doesn't say "How to paste values FROM VISIBLE/FILTERED CELLS to visible/filtered cells only in Excel?" but if my workbook is filtered, it's highly possible that this is what is needed. If this is what you want - copy from one section to another (or to simply paste values from certain cells right back to the same cells, so to remove the fomulas) you first need to copy/paste values to an unfiltered workbook/worksheet. THEN you can use the macro...or at least I hope you can. I didn't save my data and UNDO does not work....
This comment was minimized by the moderator on the site
I am sorry for that.
This comment was minimized by the moderator on the site
So is there any update version for this situation?
This comment was minimized by the moderator on the site
It is even more flexible and functional if the inner loop is constructed with Do While loop.
This comment was minimized by the moderator on the site
This was very helpful. Many thanks.
This comment was minimized by the moderator on the site
i am currently developing a macro. In that i need to do filter for a particular column for Eg: Column D and need to paste some values Eg: Valid in column B. only i need to paste the value for the filtered cells. And also i want to know the coding for multiple filters at a time. EG: filtering in one column and checking the value and again do filter in another column without making false for the previous filter. help me on this.
This comment was minimized by the moderator on the site
This works great up to record 1163 of 23,000 and then it stops. Why would it stop?
This comment was minimized by the moderator on the site
You rock! I've had this issue multiple times in the past but it became a back-breaker for the recent project. And you've helped me to fix it beautifully. THANK YOU!
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations