giovedì 19 dicembre 2019

' vba Evidenzia Celle Per Contenuto


'
Option Explicit
'
' vba Evidenzia Celle Per Contenuto
'
Sub EvidenziaCellePerContenuto()
    Dim re, strPattern As String, r As Range
    Set re = CreateObject("VBScript.RegExp")
    strPattern = InputBox("cosa deve contenure la cella:", "scelta", "")
    With re
        .Pattern = strPattern
        .IgnoreCase = True
        .Global = True
        For Each r In ActiveSheet.UsedRange
            If .test(r.Value) Then r.Interior.ColorIndex = 3
        Next r
    End With
    Set re = Nothing
End Sub
'

Nessun commento:

Posta un commento