Descricao: |
Saberexcel - o site das macros Estas macros do Aplicativo Microsoft Excel VBA, insere intermitência(piscando) na célula A1 e A8, ao encerrar a execução da macro, retira a formatação inserida, observe as macros abaixo, os loops foram programados para piscar 5(cinco) vezes, voce poderá alterá-los.
Dim NextTime As Date 'referente a ultima macro parar...
Sub Intermitente_Celula() Range("A1").Select
For compteur = 1 To 5 With Selection.Font .Name = "Arial" .Size = 14 .ColorIndex = 2 End With Application.Wait Now + TimeValue("00:00:01")
Application.Wait Now + (TimeValue("00:00:01")) / 2
With Selection.Font .Name = "Arial" .Size = 14 .ColorIndex = 0 End With Application.Wait Now + TimeValue("00:00:01") Next Range("A1").ClearFormats End Sub
Sub cor_letra_interminte() ' essa macro inserirá intermitência na celula A8 Dim nCarac, corAnt, corNovab, corNovac, corNovad nCarac = Range("A8").Characters.Count corAnt = Range("A8").Characters.Font.ColorIndex corNovab = 55 corNovac = 6 corNovad = 12 For a = 0 To 15 For b = 1 To nCarac Range("A8").Characters(Start:=b, Length:=1).Font.ColorIndex = corNovab Next b For c = 1 To nCarac Range("A8").Characters(Start:=c, Length:=1).Font.ColorIndex = corNovac Next c For d = 1 To nCarac Range("A8").Characters(Start:=d, Length:=1).Font.ColorIndex = corNovad Next d For e = 1 To nCarac Range("A8").Characters(Start:=e, Length:=1).Font.ColorIndex = corAnt Next e Next a End Sub
Macros abaixo trabalhando junsta, Parar chama a normal Esta macro com condição if(se) -- se a cor for preta fica vermelha intermitente Sub Normal() NextTime = Now + TimeValue("00:00:01") With ActiveWorkbook.Styles("Normal").Font If .ColorIndex = 2 Then .ColorIndex = 3 Else .ColorIndex = 2 End With Application.OnTime NextTime, "Normal" End Sub
Sub Parar() On Error Resume Next Application.OnTime NextTime, "Normal", schedule:=False 'Application.OnTime chamar, "Normal", , False ActiveWorkbook.Styles("Normal").Font.ColorIndex = xlAutomatic End Sub
Sub ver_código() SendKeys ("%{F11}") End Sub
Aprenda tudo sobre o Aplicativo Microsoft Excel VBA com SaberExcel
|