| | Post: 800 | Registrato il: 18/02/2010
| Città: MILANO | Età: 28 | Utente Senior | excel 2003 / 2007 | | OFFLINE | |
|
14/04/2018 21:46 | |
Ciao,
con la convalida dati è possibile che cliccando in una cella si visualizzi in messaggio pop up.
Io chiedo se possibile che questo messaggio si visualizzi dentro ad una cella.
Esempio:
clicco in A1 e in B1 venga scritto ciao
clicco in A2 e in B2 venga scritto bene e il messaggio in B1 scompaia
clicco in qualsiasi altra cella e i messaggi di B1/B2 non devono vedersi.
In A1/A2 ci sono dei dati, i messaggi in B1/B2 devono visualizzarsi solo cliccando in A1 o A2.
xam -------------------------------
excel 2003 ufficio / 2007 casa |
|
| | Post: 800 | Registrato il: 18/02/2010
| Città: MILANO | Età: 28 | Utente Senior | excel 2003 / 2007 | | OFFLINE | |
|
14/04/2018 21:58 | |
Dovrebbe essere qualcosa tipo:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Selection.Count = 1 Then
If Not Intersect(Target, Range("D2")) Is Nothing Then
Range("D2") = "ciao"
End If
End If
End Sub
però funziona solo selzionando D2.
xam -------------------------------
excel 2003 ufficio / 2007 casa |
| | Post: 3.706 | Registrato il: 21/06/2013
| Città: NAPOLI | Età: 70 | Utente Master | Excel 365 | | OFFLINE |
|
14/04/2018 22:17 | |
Nel metodo Intersect devi mettere il Range di tuo interesse (A1:A2)
Poi con un Select Case valuti l'indirizzo della cella selezionata.
Se è A1 scrivi ciao in B1.
Se è A2 scrivi bene in b2
Altrimenti cancelli b1:b2 [Modificato da alfrimpa 14/04/2018 22:17]
Alfredo |
| | Post: 801 | Registrato il: 18/02/2010
| Città: MILANO | Età: 28 | Utente Senior | excel 2003 / 2007 | | OFFLINE | |
|
15/04/2018 09:06 | |
Ciao,
non mi funziona il terzo elseif not
se diverso <> da A1:A2 cancella B1:B2
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'If Selection.Count = 1 Then
If Not Intersect(Target, Range("A1")) Is Nothing Then
Range("B1") = "ciao"
Range("B2").ClearContents
'End If
ElseIf Not Intersect(Target, Range("A2")) Is Nothing Then
Range("B2") = "bene"
Range("B1").ClearContents
'End If
ElseIf Not Intersect(Target, Range("A1,A2")) Is Nothing Then
Range("B1,B2").ClearContents
'End If
End If
End Sub
xam -------------------------------
excel 2003 ufficio / 2007 casa |
| | Post: 1.571 | Registrato il: 10/10/2013
| Città: VICENZA | Età: 69 | Utente Veteran | 365 | | OFFLINE |
|
15/04/2018 09:29 | |
ciao
non funziona no
è in conflitto con quello che hai scritto sopra.
non so cosa vuoi fare
ma prova
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'If Selection.Count = 1 Then
If Not Intersect(Target, Range("A1")) Is Nothing Then
Range("B1") = "ciao"
Range("B2").ClearContents
'End If
ElseIf Not Intersect(Target, Range("A2")) Is Nothing Then
Range("B2") = "bene"
Range("B1").ClearContents
'End If
ElseIf Intersect(Target, Range("A1:A2")) Is Nothing Then
Range("B1,B2").ClearContents
'End If
End If
End Sub
e se clicchi fuori dalle celle A1:A2
B1:B2 si cancellano
ma penso non sia quello che cerchi |
| | Post: 802 | Registrato il: 18/02/2010
| Città: MILANO | Età: 28 | Utente Senior | excel 2003 / 2007 | | OFFLINE | |
|
15/04/2018 09:41 | |
Ciao federico,
è esatto.
Un saluto a tutti.
xam -------------------------------
excel 2003 ufficio / 2007 casa |
|
|