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

altro If else endif

Ultimo Aggiornamento: 28/02/2017 08:03
Post: 644
Registrato il: 18/02/2010
Città: MILANO
Età: 28
Utente Senior
excel 2003 / 2007
OFFLINE
27/02/2017 19:58

Se B1 non è vuota aggiungi "\"
Se B1 è vuota non aggiungere "\"

Questa non va: [SM=g27826]

ART3 = ActiveSheet.Range("B1").Value

If ART3 = "" Then
MAX = ART3

ElseIf ART3 > 0 Then
MAX = ART3 & "\"

End If
End If

xam
-------------------------------
excel 2003 ufficio / 2007 casa
Post: 644
Registrato il: 18/02/2010
Città: MILANO
Età: 28
Utente Senior
excel 2003 / 2007
OFFLINE
27/02/2017 20:46

Esatto?:

If ART3 = "" Then MAX = ART3
If ART3 > "" Then MAX = ART3 & "\"

xam
-------------------------------
excel 2003 ufficio / 2007 casa
Post: 3.726
Registrato il: 13/03/2012
Città: LIVORNO
Età: 78
Utente Master
2010
OFFLINE
27/02/2017 20:47

però non fai attenzione, se guardi la discussione precedente vedrai che c'è un solo End If.
Se indenti il codice non puoi sbagliare

----------
Win 10 - Excel 2010
allega un file di esempio, guadagnerai tempo tu e lo farai risparmiare a chi ti aiuta
Post: 645
Registrato il: 18/02/2010
Città: MILANO
Età: 28
Utente Senior
excel 2003 / 2007
OFFLINE
27/02/2017 20:57

If ART3 = "" Then
MAX = ART3
If ART3 > "" Then
MAX = ART3 & "\"
End If
End If
-------------------------------
excel 2003 ufficio / 2007 casa
Post: 3.727
Registrato il: 13/03/2012
Città: LIVORNO
Età: 78
Utente Master
2010
OFFLINE
28/02/2017 08:03

continui ad andare a caso
se l'if lo completi in una sola riga non hai bisogno di end if
If ART3 = "" Then MAX = ART3
If ART3 > "" Then MAX = ART3 & "\" 

altrimenti per ogni if (NON elseif) ci deve essere un end if
If ART3 = "" Then
  MAX = ART3
ElseIf ART3 > 0 Then ' questo non vuole end if
  MAX = ART3 & "\"
End If

oppure
If ART3 = "" Then
  MAX = ART3
End If
If ART3 > 0 Then
  MAX = ART3 & "\"
End If


----------
Win 10 - Excel 2010
allega un file di esempio, guadagnerai tempo tu e lo farai risparmiare a chi ti aiuta
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:56. Versione: Stampabile | Mobile | Regolamento | Privacy
FreeForumZone [v.6.1] - Copyright © 2000-2024 FFZ srl - www.freeforumzone.com