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

วิธีการกะพริบหรือแฟลชข้อความของเซลล์ที่ระบุใน Excel

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

ข้อความกะพริบหรือกะพริบของเซลล์ที่ระบุด้วยรหัส VBA


ข้อความกะพริบหรือกะพริบของเซลล์ที่ระบุด้วยรหัส VBA

โปรดทำดังนี้เพื่อกะพริบข้อความของเซลล์ที่ระบุใน Excel

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

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

รหัส VBA: ข้อความกะพริบของเซลล์ที่ระบุใน Excel

Sub StartBlink()
'Updated by ExtendOffice 20181010
    Dim xCell As Range
    Dim xTime As Variant
      On Error Resume Next
    Set xCell = Range("Sheet2!A1")
  On Error Resume Next
   
        If xCell.Font.Color = vbRed Then
            xCell.Font.Color = vbWhite
        Else
            xCell.Font.Color = vbRed
        End If
    xTime = Now + TimeSerial(0, 0, 1)
    Application.OnTime xTime, "'" & ThisWorkbook.Name & "'!StartBlink", , True
End Sub

หมายเหตุ: ในรหัส VBA นี้ Sheet2 และ A1 ระบุว่าข้อความในเซลล์ A1 ของ Sheet2 จะกะพริบในสมุดงานปัจจุบัน

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

ตอนนี้คุณต้องมีปุ่มเพื่อเริ่มและหยุดกะพริบ

4 คลิก ผู้พัฒนา > สิ่งที่ใส่เข้าไป > ปุ่ม (การควบคุมแบบฟอร์ม). ดูภาพหน้าจอ:

5. วาดปุ่มในแผ่นงานของคุณจากนั้นคลิกไฟล์ กำหนดมาโคร กล่องโต้ตอบปรากฏขึ้นโปรดคลิก เริ่มกะพริบ ใน แมโคร ชื่อ จากนั้นคลิกที่ไฟล์ OK ปุ่ม. ดูภาพหน้าจอ:

6. คลิกขวาที่ปุ่มแทรกแล้วคลิก แก้ไขข้อความ จากเมนูคลิกขวา จากนั้นเปลี่ยนข้อความปุ่มเป็นข้อความที่คุณต้องการเช่นเริ่ม / หยุดกะพริบ

จากนี้ไปเมื่อคลิกที่ปุ่มข้อความของเซลล์ A1 จะเริ่มกะพริบ และเมื่อคลิกที่ปุ่มอีกครั้งข้อความของเซลล์ A1 จะหยุดกะพริบ

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

🤖 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 (27)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Sheet name Summary and column O

i would like to have a code to make the cell flash red/white on due date. Can someone please help?
This comment was minimized by the moderator on the site
Hi Malek,
The user Sanjeev Raghavan asked a question similar to yours, you can check the replies and see if it solves your problem.
@Sanjeev Raghavan
This comment was minimized by the moderator on the site
is it possible to make it without a button and auto ran?
This comment was minimized by the moderator on the site
Thank you Crystal. Let me try and get back to you.
This comment was minimized by the moderator on the site
Hello,
I am looking for solution to flash / blink a range of cells approaching a future date, say in one week. I mean something like a purchase order delivery date is 30 August. I would like to start flashing the cells by 25th August onwards and even after 30 August till it is delivered.
Can someone give me a solution?
Thank you,
Sanjeev.
This comment was minimized by the moderator on the site
Hi Sanjeev Raghavan,
The following VBA code can do you a favor. In the code, you need to change Sheet5!D2:D5 to the sheet name and the range you want to blink.

Sub StartBlink2()
'Updated by ExtendOffice 20220830
Dim xCell As Range
Dim xTime As Variant
Dim xRg As Range
Dim xWb As Workbook
On Error Resume Next
Dim xToday
Set xCell = Range("Sheet5!D2:D5") 'If there are spaces in your sheet name, enclose the sheet name in single quotes. If no space exists, enter the sheet name without the signe quotes
'On Error Resume Next
xToday = Now()
For Each xRg In xCell
If (xRg - xToday > -1) And (xRg - xToday <= 5) Then
If xRg.Font.Color = vbRed Then
xRg.Font.Color = vbWhite
Else
xRg.Font.Color = vbRed
End If
Else
xRg.Font.Color = vbBlack
End If
Next
Set xWb = xCell.Worksheet.Parent
xTime = Now + TimeSerial(0, 0, 1)
Application.OnTime xTime, "'" & xWb.Name & "'!StartBlink2", , True
End Sub
This comment was minimized by the moderator on the site
Hi I need to do the same for the duplicate cell value in selected column where cell value will blink if the duplicate value appeared in excel
This comment was minimized by the moderator on the site
how can i create flash blink for my time sheet .where the cell contain time above 10 hours .please suggest
This comment was minimized by the moderator on the site
Hi jass,
The following VBA code may solve your problem. Please give it a try.
Don't forget to change the sheet name and the hours range in the code.

Sub StartBlink()
'Updated by ExtendOffice 20220707
Dim xCell As Range
Dim xTime As Variant
Dim xRg As Range
Dim xWb As Workbook
On Error Resume Next
Set xCell = Range("'blinking cells'!D2:E27") 'If there are spaces in your sheet name, enclose the sheet name in single quotes. If no space exists, enter the sheet name without the signe quotes
'On Error Resume Next
For Each xRg In xCell
If xRg >= TimeValue("10:00:00") Then
If xRg.Font.Color = vbRed Then
xRg.Font.Color = vbWhite
Else
xRg.Font.Color = vbRed
End If
Else
xRg.Font.Color = vbBlack
End If
Next
Set xWb = xCell.Worksheet.Parent
xTime = Now + TimeSerial(0, 0, 1)
Application.OnTime xTime, "'" & xWb.Name & "'!StartBlink", , True
End Sub
This comment was minimized by the moderator on the site
how to make flashing specific cell containing specific Text only ?
This comment was minimized by the moderator on the site
not working,

Please help
This comment was minimized by the moderator on the site
when protect the sheet this code not working
This comment was minimized by the moderator on the site
hi, i need help in google sheets..

I need an entire row to blink if F3:F1001 contains the "STAT". the entire row should be in orange but also blinking until the the column W3:W1001's checkbox is ticked.

is it possible? can you help? pleaseeeeeeeeeeeeeee
This comment was minimized by the moderator on the site
Hi mekka,
Sorry can't help you with that. Thank you for your comment.
This comment was minimized by the moderator on the site
How do i change this to sheet 1?
This comment was minimized by the moderator on the site
Hi Sam,
If you want to make cell A1 in Sheet1 or other specific worksheet blinking, please add "Sheet1!" or other worksheet name before the cell address. See the below code line:

Set xCell = Range("Sheet1!A1")
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