#1   Report Post  
c
 
Posts: n/a
Default drop down list

Greetings;
I am curious if any one out there knows how to the hide the values in a
dropdown list. What I want to do is choose an entry from a list and based on
the choice a different drop down list will show up in the same cell. I know
how to create drop down lists that are dependant upon a previous selection
(INDIRECT) but is it possible to do this all in the same cell. Or will I
have to use two cells and format the first so the data is hidden?
  #2   Report Post  
Norman Jones
 
Posts: n/a
Default

Hi C,

See Debra Dalgleish's Dependent List, Data Validation page at:

http://www.contextures.com/xlDataVal02.html



---
Regards,
Norman



"c" wrote in message
...
Greetings;
I am curious if any one out there knows how to the hide the values in a
dropdown list. What I want to do is choose an entry from a list and based
on
the choice a different drop down list will show up in the same cell. I
know
how to create drop down lists that are dependant upon a previous selection
(INDIRECT) but is it possible to do this all in the same cell. Or will I
have to use two cells and format the first so the data is hidden?



  #3   Report Post  
Norman Jones
 
Posts: n/a
Default

Hi C,

My apologies, I responded without absorbing your same cell scenario.

Fortunately, Debra was was not similarly inattentive,

---
Regards,
Norman



"Norman Jones" wrote in message
...
Hi C,

See Debra Dalgleish's Dependent List, Data Validation page at:

http://www.contextures.com/xlDataVal02.html



---
Regards,
Norman



"c" wrote in message
...
Greetings;
I am curious if any one out there knows how to the hide the values in a
dropdown list. What I want to do is choose an entry from a list and
based on
the choice a different drop down list will show up in the same cell. I
know
how to create drop down lists that are dependant upon a previous
selection
(INDIRECT) but is it possible to do this all in the same cell. Or will I
have to use two cells and format the first so the data is hidden?





  #4   Report Post  
Debra Dalgleish
 
Posts: n/a
Default

You could use a worksheet_Change event to display the selected list, or
show the original list if the cell is cleared. For example:

'=============================
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$D$2" Then
If Application.WorksheetFunction _
.CountIf(Range("MonthList"), Target.Value) Then
With Target.Validation
.Delete
.Add Type:=xlValidateList, _
AlertStyle:=xlValidAlertStop, _
Operator:=xlBetween, _
Formula1:="=" & Target.Value
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
Else
If Target.Value = "" Then
With Target.Validation
.Delete
.Add Type:=xlValidateList, _
AlertStyle:=xlValidAlertStop, _
Operator:=xlBetween, _
Formula1:="=MonthList"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End If
End If
End If
End Sub

'=============================

c wrote:
Greetings;
I am curious if any one out there knows how to the hide the values in a
dropdown list. What I want to do is choose an entry from a list and based on
the choice a different drop down list will show up in the same cell. I know
how to create drop down lists that are dependant upon a previous selection
(INDIRECT) but is it possible to do this all in the same cell. Or will I
have to use two cells and format the first so the data is hidden?



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

  #5   Report Post  
c
 
Posts: n/a
Default

Thank you both for the help.

I think this macro will work well for me but it may conflict with another
oneI am already using that creates a second sheet based on the first. So
before I go through the long process of updating the second macro is there
any other methods that could accomplish this?

Thanks again,
c

"Debra Dalgleish" wrote:

You could use a worksheet_Change event to display the selected list, or
show the original list if the cell is cleared. For example:

'=============================
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$D$2" Then
If Application.WorksheetFunction _
.CountIf(Range("MonthList"), Target.Value) Then
With Target.Validation
.Delete
.Add Type:=xlValidateList, _
AlertStyle:=xlValidAlertStop, _
Operator:=xlBetween, _
Formula1:="=" & Target.Value
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
Else
If Target.Value = "" Then
With Target.Validation
.Delete
.Add Type:=xlValidateList, _
AlertStyle:=xlValidAlertStop, _
Operator:=xlBetween, _
Formula1:="=MonthList"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End If
End If
End If
End Sub

'============================



  #6   Report Post  
c
 
Posts: n/a
Default

Thanks Debra,

The code works great except when I attempt to use the additional macro I
have already created. It copies the sheet for the next day. It then gives
me a type mismatch error on the day2 sheet at
If Application.WorksheetFunction _
.CountIf("OFFICE", Target.Value).

Any help with this error would be greatly appreciated!

Thanks in advance
c


  #7   Report Post  
Debra Dalgleish
 
Posts: n/a
Default

It depends what your other macro is doing, but perhaps you could disable
events at the start of your macro, then enable them at the end. For example:

Application.EnableEvents = False
'your macro here
Application.EnableEvents = True

c wrote:
Thanks Debra,

The code works great except when I attempt to use the additional macro I
have already created. It copies the sheet for the next day. It then gives
me a type mismatch error on the day2 sheet at
If Application.WorksheetFunction _
.CountIf("OFFICE", Target.Value).

Any help with this error would be greatly appreciated!

Thanks in advance
c




--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

  #8   Report Post  
c
 
Posts: n/a
Default

Debra,
Thanks again for your input it has worked perfectly and the macro that
copies works excellent. One more question if you don't mind. When I try to
delete the entries in the first list or the second list I get a type 13
mismatch error at:

If Application.WorksheetFunction _
.CountIf(Range("R30"), Target.Value) Then

Is there a way to exit the macro if the delete key is entered or is there
any way to remove this error.

Thanks again for your time,
c

"Debra Dalgleish" wrote:

It depends what your other macro is doing, but perhaps you could disable
events at the start of your macro, then enable them at the end. For example:

Application.EnableEvents = False
'your macro here
Application.EnableEvents = True


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change fonts in drop down list Dennis Excel Discussion (Misc queries) 1 January 12th 05 01:49 PM
formatting drop down list dennis Excel Discussion (Misc queries) 2 January 11th 05 04:21 PM
create a drop down list with the source from a different workbook Sampath Excel Discussion (Misc queries) 2 January 8th 05 07:57 PM
edit a drop down list paulp Excel Discussion (Misc queries) 1 December 22nd 04 03:20 PM
Drop dow list complication Ryan Excel Discussion (Misc queries) 2 December 16th 04 07:49 PM


All times are GMT +1. The time now is 09:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"