| | Post: 144 | Registrato il: 12/04/2013
| Città: BARI | Età: 34 | Utente Junior | 2016 | | OFFLINE | |
|
13/07/2017 17:06 | |
Ciao ragazzi, mi servirebbe una macro per cercare se i valori contenuti nelle celle delle colonne D ed E sono presenti nella colonna A.
Qualsiasi tipo di segnalazione va bene, anche un semplice sfondo giallo sul valore.
Grazie.
P.S: non ho caricato nessun file esempio solo perchè credo che sia intuibile già cosi la richiesta, caso contrario ve lo carico.
Grazie :) |
|
| | Post: 1.469 | Registrato il: 06/04/2013
| Utente Veteran | 2010 | | OFFLINE |
|
13/07/2017 17:30 | |
Ciao
ma devi cercare in colonna A tutti i valori presenti nelle celle in D ed E oppure uno per volta?
E poi una volta evidenziato i/il valori/e cercato deve toglire l'evidenziazione per le successive richieste?..altrimenti alla fine la colonna A sarà tutta una evidenziazione.
saluti
[Modificato da dodo47 13/07/2017 17:30] Domenico
Win 10 - Excel 2016 |
| | Post: 144 | Registrato il: 12/04/2013
| Città: BARI | Età: 34 | Utente Junior | 2016 | | OFFLINE | |
|
13/07/2017 18:16 | |
Praticamente D ed E sono due colonne in cui ho valori, diversi. Questi potrebbero essere presenti in A. Se si, basta che si evidenzi la cella. Anche se diventa tutto giallo :=) |
| | Post: 1.471 | Registrato il: 06/04/2013
| Utente Veteran | 2010 | | OFFLINE |
|
13/07/2017 19:01 | |
Ciao
...contento tu....
saluti
Sub xx()
Dim ToFind As Range, wFind As Range, cel As Range, rToFind As Long
Dim rD As Long, rE As Long, c As Object, firstAddress As String
rD = Range("D" & Rows.Count).End(xlUp).Row
rE = Range("E" & Rows.Count).End(xlUp).Row
If rD >= rE Then rToFind = rD Else rToFind = rE
Set ToFind = Range("D1:E" & rToFind)
Set wFind = Range("A:A")
For Each cel In ToFind
If Not IsEmpty(cel.Value) Then
With wFind
Set c = .Find(cel.Value, LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
firstAddress = c.Address
Do
Range(c.Address).Interior.ColorIndex = 4
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
End If
Next cel
Set ToFind = Nothing
Set wFind = Nothing
Set c = Nothing
End Sub
Domenico
Win 10 - Excel 2016 |
| | Post: 145 | Registrato il: 12/04/2013
| Città: BARI | Età: 34 | Utente Junior | 2016 | | OFFLINE | |
|
13/07/2017 19:09 | |
Graziee :) |
|
|