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

avviso buongiorno

Ultimo Aggiornamento: 28/10/2019 20:20
Post: 446
Registrato il: 28/05/2011
Città: MILANO
Età: 43
Utente Senior
excel 2000/2007
OFFLINE
26/10/2019 21:46

Ciao,
come coggere gli else?

If ActiveSheet.Range("L1").Value > 6 Or ActiveSheet.Range("L1").Value < 12 Then
ActiveSheet.Unprotect "123456"
ActiveSheet.Range("M1").Value = "Buon giorno"
ActiveSheet.Protect "123456"

ElseIf ActiveSheet.Range("L1").Value > 12 Or ActiveSheet.Range("L1").Value < 17 Then
ActiveSheet.Unprotect "123456"
ActiveSheet.Range("M1").Value = "Buon pomeriggio"
ActiveSheet.Protect "123456"

ElseIf ActiveSheet.Range("L1").Value > 17 Then
ActiveSheet.Unprotect "123456"
ActiveSheet.Range("M1").Value = "Buona sera"
ActiveSheet.Protect "123456"

End If

john
[Modificato da john_cash 26/10/2019 22:19]
---------------
excel 2007
Post: 743
Registrato il: 24/06/2015
Città: CATANIA
Età: 80
Utente Senior
Excel2019
OFFLINE
27/10/2019 08:03

Ciao
Nel Modulo del Foglio interessato metterei questo codice
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("L1")) Is Nothing Then
  Set sh = ActiveSheet
  Set ora = sh.Range("L1")
  If ora.Value < 12 Then
     slt = "Buon giorno"
  ElseIf ora.Value >= 12 And ora.Value < 17 Then
    slt = "Buon pomeriggio"
  ElseIf ora.Value >= 17 And ora < 22 Then
    slt = "Buona sera"
  ElseIf ora.Value >= 22 Then
    slt = "Buona notte"
  End If
  sh.Unprotect "123456"
  sh.Range("M1") = slt
  sh.Protect "123456"
  Set sh = Nothing
  Set ora = Nothing
End If

End Sub


Ciao,
Mario
Post: 446
Registrato il: 28/05/2011
Città: MILANO
Età: 43
Utente Senior
excel 2000/2007
OFFLINE
28/10/2019 20:20

Ciao marius, funziona.
Un saluto e grazie.
john
---------------
excel 2007
Vota:
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 22:03. Versione: Stampabile | Mobile | Regolamento | Privacy
FreeForumZone [v.6.1] - Copyright © 2000-2024 FFZ srl - www.freeforumzone.com