Advertisement
Miketo_prog

Feliz Cumple

Sep 12th, 2023
1,098
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VBScript 0.96 KB | Software | 0 0
  1. Sub Animacion()
  2.     Dim Rango As Range
  3.     Set Rango = ThisWorkbook.Worksheets("Hoja1").Range("A1:P25")
  4.     Rango.Interior.Color = RGB(0, 0, 0)
  5.    
  6.     TextoPausado "Feliz Cumpleaños Ing Asael!!!"
  7. End Sub
  8.  
  9. Function TextoPausado(texto As String)
  10.     Dim MiCelda As Range
  11.     Dim TextoParcial As String
  12.     Dim i As Integer
  13.    
  14.     Ajustes MiCelda, "C10"
  15.    
  16.     ' Loop para escribir letra por letra
  17.    For i = 1 To Len(texto)
  18.         TextoParcial = Mid(texto, 1, i)
  19.         MiCelda.Value = TextoParcial
  20.         Pause 0.4
  21.         DoEvents
  22.     Next i
  23. End Function
  24.  
  25. Function Pause(ByVal Seconds As Double)
  26.     Dim EndTime As Double
  27.     EndTime = Timer + Seconds
  28.     Do While Timer < EndTime
  29.         DoEvents
  30.     Loop
  31. End Function
  32.  
  33. Function Ajustes(Celda As Range, Pos As String)
  34.     Set Celda = ThisWorkbook.Worksheets("Hoja1").Range(Pos)
  35.    
  36.     Celda.Value = ""
  37.     Celda.Font.Color = RGB(32, 245, 10)
  38.     Celda.Font.Size = 39
  39. End Function
  40.  
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement