Note: The other languages of the website are Google-translated. Back to English
Mewngofnodi  \/ 
x
or
x
Cofrestru  \/ 
x

or

Sut i amrantu neu fflachio testun cell benodol yn Excel?

Ar gyfer gwneud cell benodol yn rhagorol yn eich taflen waith, beth am amrantu testun y gell hon? Bydd yr erthygl hon yn dangos dull i chi o amrantu testun cell benodol yn Excel.

Testun blincio neu fflachio cell benodol gyda chod VBA


Testun blincio neu fflachio cell benodol gyda chod VBA

Gwnewch fel a ganlyn i amrantu testun cell benodol yn Excel.

1. Gwasgwch Alt + F11 allweddi ar yr un pryd i agor y Microsoft Visual Basic ar gyfer Ceisiadau ffenestr.

2. Yn y Microsoft Visual Basic ar gyfer Ceisiadau ffenestr, cliciwch Mewnosod > Modiwlau. Yna copïwch a gludwch y cod canlynol i mewn i ffenestr y Cod.

Cod VBA: Testun blincio cell benodol yn 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

Nodyn: yn y cod VBA hwn, mae Sheet2 ac A1 yn nodi y bydd y testun yng nghell A1 o Daflen 2 yn cael ei flincio yn y llyfr gwaith cyfredol.

3. Gwasgwch y Alt + Q allweddi ar yr un pryd i gau'r Microsoft Visual Basic ar gyfer Ceisiadau ffenestr.

Nawr mae angen botwm arnoch chi i ddechrau ac atal y amrantu.

4. Cliciwch Datblygwr > Mewnosod > Botwm (Rheoli Ffurflen). Gweler y screenshot:

5. Tynnwch botwm yn eich taflen waith, yna a Neilltuo Macro blwch deialog yn ymddangos, cliciwch StartBlink yn y Macro enw blwch, ac yna cliciwch ar y OK botwm. Gweler y screenshot:

6. De-gliciwch y botwm wedi'i fewnosod, a chlicio Golygu Testun o'r ddewislen clicio ar y dde. Yna newid testun y botwm i'r testun sydd ei angen arnoch chi fel Start / Stop Blinking.

O hyn ymlaen, wrth glicio ar y botwm, mae testun cell A1 yn dechrau blincio. Ac wrth glicio ar y botwm eto, mae testun cell A1 yn stopio amrantu.


Yr Offer Cynhyrchedd Swyddfa Gorau

Mae Kutools for Excel yn Datrys y rhan fwyaf o'ch Problemau, ac yn Cynyddu Eich Cynhyrchedd 80%

  • Ailddefnyddio: Mewnosod yn gyflym fformwlâu cymhleth, siartiau ac unrhyw beth rydych chi wedi'i ddefnyddio o'r blaen; Amgryptio Celloedd gyda chyfrinair; Creu Rhestr Bostio ac anfon e-byst ...
  • Bar Fformiwla Gwych (golygu llinellau lluosog o destun a fformiwla yn hawdd); Cynllun Darllen (darllen a golygu nifer fawr o gelloedd yn hawdd); Gludo i'r Ystod Hidlo...
  • Uno Celloedd / Rhesi / Colofnau heb golli Data; Cynnwys Celloedd Hollt; Cyfuno Rhesi / Colofnau Dyblyg... Atal Celloedd Dyblyg; Cymharwch y Meysydd...
  • Dewiswch Dyblyg neu Unigryw Rhesi; Dewiswch Blank Rows (mae pob cell yn wag); Darganfyddiad Gwych a Darganfyddiad Niwlog mewn Llawer o Lyfrau Gwaith; Dewis ar Hap ...
  • Copi Union Celloedd Lluosog heb newid cyfeirnod fformiwla; Auto Creu Cyfeiriadau i Daflenni Lluosog; Mewnosod Bwledi, Blychau Gwirio a mwy ...
  • Testun Detholiad, Ychwanegu Testun, Tynnu yn ôl Swydd, Tynnwch y Gofod; Creu ac Argraffu Subtotals Paging; Trosi rhwng Cynnwys a Sylwadau Celloedd...
  • Hidlo Super (arbed a chymhwyso cynlluniau hidlo i ddalenni eraill); Trefnu Uwch yn ôl mis / wythnos / dydd, amlder a mwy; Hidlo Arbennig gan feiddgar, italig ...
  • Cyfuno Llyfrau Gwaith a Thaflenni Gwaith; Uno Tablau yn seiliedig ar golofnau allweddol; Rhannwch Ddata yn Daflenni Lluosog; Trosi Swp xls, xlsx a PDF...
  • Mwy na 300 o nodweddion pwerus. Yn cefnogi Swyddfa / Excel 2007-2019 a 365. Yn cefnogi pob iaith. Defnydd hawdd yn eich menter neu sefydliad. Nodweddion llawn treial am ddim 30 diwrnod. Gwarant arian yn ôl 60 diwrnod.
tab kte 201905

Mae Tab Office yn Dod â rhyngwyneb Tabbed i'r Swyddfa, a Gwneud Eich Gwaith yn Haws o lawer

  • Galluogi golygu a darllen tabbed yn Word, Excel, PowerPoint, Cyhoeddwr, Mynediad, Visio a Phrosiect.
  • Agor a chreu dogfennau lluosog mewn tabiau newydd o'r un ffenestr, yn hytrach nag mewn ffenestri newydd.
  • Yn cynyddu eich cynhyrchiant 50%, ac yn lleihau cannoedd o gliciau llygoden i chi bob dydd!
gwaelod officetab
Say something here...
symbols left.
You are guest
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    shalim · 5 months ago
    how to make flashing specific cell containing specific Text only ?

  • To post as a guest, your comment is unpublished.
    connie · 1 years ago
    not working,

    Please help
  • To post as a guest, your comment is unpublished.
    Shreenivas AK · 1 years ago
    when protect the sheet this code not working
  • To post as a guest, your comment is unpublished.
    mekka · 2 years ago
    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
    • To post as a guest, your comment is unpublished.
      crystal · 1 years ago
      Hi mekka,
      Sorry can't help you with that. Thank you for your comment.
  • To post as a guest, your comment is unpublished.
    baburaj.sasco@gmail.com · 2 years ago
    How can I put a condition to blink certain cells if its value is below a limit, say below 30, without using the button. Also, i will be using a protected sheet. Thanks in advance for your help.
  • To post as a guest, your comment is unpublished.
    Sam · 2 years ago
    How do i change this to sheet 1?
    • To post as a guest, your comment is unpublished.
      crystal · 2 years ago
      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")
  • To post as a guest, your comment is unpublished.
    SUNARYANTO · 2 years ago
    MANTEB GAN
  • To post as a guest, your comment is unpublished.
    alassail.survey@gmail.com · 2 years ago
    Working. good
    But after protecting my sheet LOCK & Hidden ( except blinking cell ) it's not working.
    Anyone plz help me solve this issue.
  • To post as a guest, your comment is unpublished.
    Rashid Imam · 2 years ago
    Hi,
    it's working well but when I am protecting my sheet then blinking is not working showing debug msg.
    • To post as a guest, your comment is unpublished.
      crystal · 2 years ago
      Good day,
      Please try the following code.

      Sub StartBlink()
      Dim xCell As Range
      Dim xTime As Variant
      On Error Resume Next
      Set xCell = Range("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
  • To post as a guest, your comment is unpublished.
    Dayle · 3 years ago
    How do I include this code in the following so I don't need buttons but the blinking starts automatically on the workbook opening?

    Private Sub Workbook_Open()

    ' code here

    End Sub
    • To post as a guest, your comment is unpublished.
      crystal · 3 years ago
      Hi Dayle,
      Please put this code into the ThisWorkbook window.

      'Put in“ThisWorkbook”window
      Private Sub Workbook_Open()
      StarBlink
      End Sub

      Put the below code into the Module window. And then save the workbook as an Excel Macro-enabled Workbook. Hope I can help. Thanks for your comment.

      'Start blinking
      Sub StarBlink()
      Dim xCell As Range
      Dim xTime As Variant
      Set xCell = Range("A1")
      With ThisWorkbook.Worksheets("Sheet1").Range("A1").Font
      If xCell.Font.Color = vbRed Then
      xCell.Font.Color = vbWhite
      Else
      xCell.Font.Color = vbRed
      End If
      End With
      xTime = Now + TimeSerial(0, 0, 1)
      Application.OnTime xTime, "" & ThisWorkbook.Name & "!StarBlink", , True
      End Sub
      'Stop blinking
      Sub StopBlink()
      xTime = Now + TimeSerial(0, 0, 1)
      Application.OnTime EarliestTime:=xTime, Procedure:="" & ThisWorkbook.Name & "!StarBlink", Schedule:=False
      End Sub
  • To post as a guest, your comment is unpublished.
    Rafi · 3 years ago
    Working... Great
  • To post as a guest, your comment is unpublished.
    Hana · 4 years ago
    How can it make a random cell blink in a certain range?
  • To post as a guest, your comment is unpublished.
    Geoff Culbertson · 4 years ago
    Could this blinking text be applied to a condition. i.e. if a date is reached or is approaching on one worksheet, a cell on a cover/menu sheet flashes
  • To post as a guest, your comment is unpublished.
    Ken · 4 years ago
    This code will not stop the blinking it get stuck. What am I doing wrong?