que tal resulta que tengo una macro que lo que hace es poner una letra en la celda segun el color de la celda pero el problema es que tarda mucho en ejecutarse ya que son muchas celdas, solo para pedir si alguien me puede decir como hacer que se ejecute mas rapido aqui dejo el programa, saludos.
Sub prueba()
Application.ScreenUpdating = False
Dim celda As Range
Range("h:h").Select
For Each celda In Selection
If celda.Interior.Color = RGB(255, 255, 255) Then
celda = "V"
End If
Next
Application.ScreenUpdating = True
For Each celda In Selection
If celda.Interior.Color = 255 Then
celda = "R"
End If
Next
Application.ScreenUpdating = True
For Each celda In Selection
If celda.Interior.Color = RGB(34, 139, 34) Then
celda = "A"
End If
Next
Application.ScreenUpdating = True
For Each celda In Selection
If celda.Interior.Color = RGB(192, 192, 192) Then
celda = "V"
End If
Next
Application.ScreenUpdating = True
End Sub
Featured Replies
Archivado
Este tema está ahora archivado y está cerrado a más respuestas.
que tal resulta que tengo una macro que lo que hace es poner una letra en la celda segun el color de la celda pero el problema es que tarda mucho en ejecutarse ya que son muchas celdas, solo para pedir si alguien me puede decir como hacer que se ejecute mas rapido aqui dejo el programa, saludos.
Sub prueba()
Application.ScreenUpdating = False
Dim celda As Range
Range("h:h").Select
For Each celda In Selection
If celda.Interior.Color = RGB(255, 255, 255) Then
celda = "V"
End If
Next
Application.ScreenUpdating = True
For Each celda In Selection
If celda.Interior.Color = 255 Then
celda = "R"
End If
Next
Application.ScreenUpdating = True
For Each celda In Selection
If celda.Interior.Color = RGB(34, 139, 34) Then
celda = "A"
End If
Next
Application.ScreenUpdating = True
For Each celda In Selection
If celda.Interior.Color = RGB(192, 192, 192) Then
celda = "V"
End If
Next
Application.ScreenUpdating = True
End Sub