Condividi tramite

ATTIVARE MACRO AL VARIARE DI UN VALORE SPECIFICO DI UNA COLONNA

Anonimo
2023-11-24T09:23:55+00:00

Buongiorno ,

come descritto in oggetto mi servirebbe capire come attivare più MACRO al variare di un valore specifico di un intera colonna ( o intervallo). Ora sono solo riuscito ad impostare una singola cella come target tramite :

Private Sub worksheet_change(ByVal target As Range)

Set target = Range("F7")

If target.Value = "750" Then

Call MACRO1

End If

If target.Value = "900" Then

Call MACRO2

End If

If target.Value = "1000" Then

Call MACRO3

End If

End Sub

grazie mille i anticipo

Microsoft 365 e Office | Excel | Per il lavoro | Windows

Domanda bloccata. Questa domanda è stata eseguita dalla community del supporto tecnico Microsoft. È possibile votare se è utile, ma non è possibile aggiungere commenti o risposte o seguire la domanda.

0 commenti Nessun commento

Risposta accettata dall'autore della domanda

Eleuterio Tedeschi 18,590 Punti di reputazione Moderatore volontario
2023-11-24T09:57:54+00:00

si sono valori all'interno di una cella

Allora togli le virgolette, ma il concetto è lo stesso:

Private Sub Worksheet_Change(ByVal Target As Range) 

    If Not Intersect(Target, Range("F7:F700")) Is Nothing Then 

        Select Case Target.Value 

            Case 750

                MACRO1 

            Case 900 

                MACRO2 

            Case 1000 

                MACRO3 

        End Select 

    End If 

End Sub

La risposta è stata utile?

1 persona ha trovato utile questa risposta.
0 commenti Nessun commento

2 risposte aggiuntive

Ordina per: Più utili
  1. Anonimo
    2023-11-24T09:37:50+00:00

    si sono valori all'interno di una cella

    La risposta è stata utile?

    0 commenti Nessun commento
  2. Eleuterio Tedeschi 18,590 Punti di reputazione Moderatore volontario
    2023-11-24T09:29:23+00:00

    Buongiorno ,

    come descritto in oggetto mi servirebbe capire come attivare più MACRO al variare di un valore specifico di un intera colonna ( o intervallo). Ora sono solo riuscito ad impostare una singola cella come target tramite :

    Private Sub worksheet_change(ByVal target As Range)

    Set target = Range("F7")

    If target.Value = "750" Then

    Call MACRO1

    End If

    If target.Value = "900" Then

    Call MACRO2

    End If

    If target.Value = "1000" Then

    Call MACRO3

    End If

    End Sub

    grazie mille i anticipo

    Prova così:

    Private Sub Worksheet_Change(ByVal Target As Range) 
    
        If Not Intersect(Target, Range("F7:F700")) Is Nothing Then 
    
            Select Case Target.Value 
    
                Case "750"
    
                    MACRO1 
    
                Case "900" 
    
                    MACRO2 
    
                Case "1000" 
    
                    MACRO3 
    
            End Select 
    
        End If 
    
    End Sub
    

    Ma sei sicuro che siano stringhe e non valori nella cella?

    Ciao.

    La risposta è stata utile?

    0 commenti Nessun commento