Pagina precedente | 1 | Pagina successiva
Vota | Stampa | Notifica email    
Autore

Colorazione automatica/dinamica cella a seconda del suo valore

Ultimo Aggiornamento: 03/10/2018 07:53
Post: 13
Registrato il: 26/09/2018
Città: PISOGNE
Età: 43
Utente Junior
2016
OFFLINE
02/10/2018 16:43

Buongiorno,

è tutto il giorno che cerco di far colorare automaticamente una cella di verde piuttosto che di rosso in base al valore, ma non ci riesco in nessun modo! Perchè non funziona?
Help... grazie 2000

Private Sub Worksheet_Change(ByVal Target As Range)
Sheets("Tabelle").Select
If Range("N16").Value > N19 Then
Range("N16").Select
With Selection.Interior
.ColorIndex = 3 ' colore rosso
.Pattern = xlSolid
End With
End If
If Range("N16").Value <= N19 Then
Range("N16").Select
With Selection.Interior
.ColorIndex = 4 ' colore verde
.Pattern = xlSolid
End With
End If
End Sub

Saluti

Andrea
Post: 1.724
Registrato il: 10/10/2013
Città: VICENZA
Età: 69
Utente Veteran
365
OFFLINE
02/10/2018 17:14

ciao

chiediti cosa vuol dire per il vba >N19


Private Sub Worksheet_Change(ByVal Target As Range)
Sheets("Tabelle").Select
If Range("N16").Value > Range("N19").Value Then
Range("N16").Select
With Selection.Interior
.ColorIndex = 3 ' colore rosso
.Pattern = xlSolid
End With
Else
If Range("N16").Value <= Range("N19").Value Then
Range("N16").Select
With Selection.Interior
.ColorIndex = 4 ' colore verde
.Pattern = xlSolid
End With
End If
End If
End Sub

Post: 2.088
Registrato il: 21/03/2008
Città: LOCATE VARESINO
Età: 76
Utente Veteran
2007 / 13
OFFLINE
02/10/2018 18:47

ciao

intanto saluto federico

dovendo fare due semplici operazioni possiamo ridurre tutta la sub()


Private Sub Worksheet_Change(ByVal Target As Range)
Sheets("Tabelle").Select
If Range("N16").Value > Range("N19").Value Then
Range("N16").Interior.ColorIndex = 3 ' colore rosso
Else
Range("N16").Interior.ColorIndex = 4 ' colore verde
End If
End Sub

Ciao da locate
excel 2007 / 13
Post: 14
Registrato il: 26/09/2018
Città: PISOGNE
Età: 43
Utente Junior
2016
OFFLINE
03/10/2018 07:53

Grazie locate e grazie federico!
[SM=x423017]
Vota: 15MediaObject5,0024 2
Amministra Discussione: | Chiudi | Sposta | Cancella | Modifica | Notifica email Pagina precedente | 1 | Pagina successiva
Nuova Discussione
 | 
Rispondi
Cerca nel forum
Tag discussione
Discussioni Simili   [vedi tutte]
Feed | Forum | Bacheca | Album | Utenti | Cerca | Login | Registrati | Amministra
Tutti gli orari sono GMT+01:00. Adesso sono le 18:36. Versione: Stampabile | Mobile | Regolamento | Privacy
FreeForumZone [v.6.1] - Copyright © 2000-2024 FFZ srl - www.freeforumzone.com