Lista desplegable activa/inactiva en función de otra celda

Solo consultas sobre Funciones y Fórmulas Excel.

Reglas del Foro
1. Antes de hacer tu pregunta intenta con el buscador de este foro (muchas preguntas ya fueron respondidas antes!)
2. Si haces una nueva pregunta, es muy recomendable que adjuntes el ejemplo Excel para poder comprenderla mejor!
3. Realiza tu pregunta de forma clara, explicando bien cada paso de lo que haces y tendrás más probabilidad de respuesta!
Compartir en:
     

Lista desplegable activa/inactiva en función de otra celda

Notapor elvinagres » 31 Ene 2012 09:19

Hola

Estoy intentando montar un formulario y me encuentro con el siguiente problema que no sé si será posible resolver.

En una parte de mi formulario tengo.

Campo a Modificar - Es una lista desplegable con dos valores DESCRIPCION y PROCESO
Valor Nuevo - El valor que quiero que luego se grabe (con una macro) en la tabla final.

Bien. Mi idea es que hacer que el campo VALOR NUEVO sea una lista desplegable si CAMPO a MODIFICAR es PROCESO y que se aun campo LIBRE (sin validacíón) si CAMPO a MODIFICAR es DESCRIPCION. ¿Lo veis posible?

Muchas gracias,
* Te recomendamos estos productos Excel: Manual de Macros | Manual de Funciones | Nuevas Funciones | ddTraDa
elvinagres
Miembro Nuevo
Miembro Nuevo
 
Registrado: 31 Ene 2012 05:54

Re: Lista desplegable activa/inactiva en función de otra cel

Notapor xpelos » 08 Feb 2012 11:51

Bueno:

mira a ver si el adjunto te da una idea, aunque sea sin macros, que de eso no tengo ni papa idea.

Si la celda B2 contiene 'Proceso', en la celda B5 podrás elegir los procesos.
Si la celda B2 contiene 'Descripción' (esta celda está validada a esos dos valores), entonces, en [B5] escribes lo que te dé la gana.

Espero que te sirva.
No tiene los permisos requeridos para ver los archivos adjuntos a este mensaje.
* Te recomendamos estos productos Excel: Manual de Macros | Manual de Funciones | Nuevas Funciones | ddTraDa
xpelos
Miembro Frecuente
Miembro Frecuente
 
Registrado: 18 Ene 2006 12:39

Re: Lista desplegable activa/inactiva en función de otra cel

Notapor elvinagres » 14 Feb 2012 12:14

Muchas gracias,

Al final lo resolvi así (no me preguntes la lógica porque fue una mezcla de ideas tras mucho buscar... :lol: )

Private Sub Worksheet_Change(ByVal Target As Range)

datos = "J8"

If Not Application.Intersect(Target, Range(datos)) Is Nothing Then

Listas

End If
End Sub

Siendo Listas:

Dim celda As String

celda = Range("J8")

If celda = "CATEGORÍA" Then

Range("J10").Select

With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=categorias"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True

End With

Else
If celda = "DESCRIPCIÓN" Then

Range("J10").Select


With Selection.Validation
.Delete
.Add Type:=xlValidateInputOnly, AlertStyle:=xlValidAlertStop, Operator _
:=xlBetween
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With


Else

If celda = "PROCESO" Then

Range("J10").Select

With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=Procesos"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True

End With

Else

If celda = "AMBITO" Then

Range("J10").Select

With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=Ambitos"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True

End With

Else
If celda = "SOCIEDAD" Then

Range("J10").Select

With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=Sociedades"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True

End With

Else

If celda = "DEPENDENCIA" Then

Range("J10").Select


With Selection.Validation
.Delete
.Add Type:=xlValidateInputOnly, AlertStyle:=xlValidAlertStop, Operator _
:=xlBetween
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With

Else

If celda = "" Then

Range("J10").Select


With Selection.Validation
.Delete
.Add Type:=xlValidateInputOnly, AlertStyle:=xlValidAlertStop, Operator _
:=xlBetween
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With



End If
End If
End If
End If
End If
End If
End If

End Sub
* Te recomendamos estos productos Excel: Manual de Macros | Manual de Funciones | Nuevas Funciones | ddTraDa
elvinagres
Miembro Nuevo
Miembro Nuevo
 
Registrado: 31 Ene 2012 05:54


Compartir en:
     

  • Anuncio
Manual Excel avanzado

Volver a Funciones y Fórmulas

¿Quién está conectado?

Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 1 invitado