Notifications
Clear all

Ano lista suspensa

6 Posts
3 Usuários
0 Reactions
1,327 Visualizações
(@vonzuben)
Posts: 549
Prominent Member
Topic starter
 

Como posso adicionar 1 ano a mais para FA e MA

Se E14 = F
entao, lista supensa F14 terá FA18, FB17 e FC17

Se E14 = M
entao, lista supensa F14 terá MA18, MB17 e MC17

Número 17 referente ao ano 2017, mas quero que FA e MA fica com 18 de 2018

Obrigado !

 
Postado : 05/12/2017 1:54 pm
(@fcarlosc)
Posts: 0
New Member
 

Não entendi muito bem, mais vai lá em "Validação de Dados" que tem a sequencia.

 
Postado : 05/12/2017 3:28 pm
(@vonzuben)
Posts: 549
Prominent Member
Topic starter
 

Não entendi muito bem, mais vai lá em "Validação de Dados" que tem a sequencia.

É VBA, conforme expliquei coloca 17 como 2017 depois do código

 
Postado : 05/12/2017 7:51 pm
(@vonzuben)
Posts: 549
Prominent Member
Topic starter
 

Fiz essa planilha e será mais fácil de entender

Quase pronto, só preciso que Gato e Laranja seja 18

 
Postado : 05/12/2017 10:25 pm
(@fernandofernandes)
Posts: 43750
Illustrious Member
 

Eu continuo com dificuldade em entender vossas demandas, contudo experimente:

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False

If Range("F14") = "Animal" And ActiveCell.Value = "Gato" Then ActiveCell.Value = ActiveCell & Right(Year(Date), 2) + 1
If Range("F14") = "Animal" And ActiveCell.Value = "Avez" Or ActiveCell.Value = "Peixe" Then
ActiveCell.Value = ActiveCell & Right(Year(Date), 2)
End If

If Range("f14") = "Frutas" And ActiveCell.Value = "Laranja" Then ActiveCell.Value = ActiveCell & Right(Year(Date), 2) + 1
If Range("f14") = "Frutas" And ActiveCell.Value = "Abacaxi" Or ActiveCell.Value = "Pera" Then
ActiveCell.Value = ActiveCell & Right(Year(Date), 2)
End If

Application.EnableEvents = True
End Sub

 
Postado : 06/12/2017 6:32 am
(@vonzuben)
Posts: 549
Prominent Member
Topic starter
 

Perfeito Reinaldo !

Tinha feito quase igual, mas não tinha colocado outro if e sim else
Obrigado !

 
Postado : 06/12/2017 7:27 am