Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
rgs rgs is offline
external usenet poster
 
Posts: 3
Default excel drop down box used conditionally based on previous input

I want a cell to have a drop down box to select from only when a prior cell
entry is true. Otherwise the cell will be blank, no drop down box, waiting
for the users input.

I appreciate the assistance.

Regards,

RGS
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 857
Default excel drop down box used conditionally based on previous input

Hi,

You would probably need to do that with VBA triggered by an Change event:

Here is some sample code:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim isect As Range
Set isect = Application.Intersect(Target, Range("A1:A10"))
If Not isect Is Nothing Then
'Your code he
If target = True Then
Range("F1").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,
Operator:= _
xlBetween, Formula1:="=mylist"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
Else
With Selection.Validation
.Delete
.Add Type:=xlValidateInputOnly, AlertStyle:=xlValidAlertStop,
Operator _
:=xlBetween
.IgnoreBlank = True
.InCellDropdown = True
.ShowInput = True
.ShowError = True
End With
End If
End If
End Sub

Here the A1:A10 is the trigger cell, meaning the one that determines whether
there will be data validation or not in you other cell. Record the adding of
the data validation and the removing of the data validiation and stick them
in above. I have put in a quick sample.

1. To add this code to your file, press Alt+F11,
2. In the VBAProject window, top left side, find your sheet name under your
file name and double click it.
3. Paste in or type the code above.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"RGS" wrote:

I want a cell to have a drop down box to select from only when a prior cell
entry is true. Otherwise the cell will be blank, no drop down box, waiting
for the users input.

I appreciate the assistance.

Regards,

RGS

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
Saving without deleting previous input kdmarvin Excel Worksheet Functions 10 March 14th 07 09:51 PM
auto populate cell based on previous cell drop down list selectio. PuzzledbyLists Excel Discussion (Misc queries) 2 September 11th 06 01:28 AM
create 3 drop down menus in Excel, each relating to previous ExcelDropDownQ Excel Worksheet Functions 2 May 24th 06 08:26 PM
Lock and unlock cells conditionally depending on input in another Frustrated Excel Worksheet Functions 1 November 11th 05 03:36 PM
How do I add input data in the input ranges in drop down boxes. oil_driller Excel Discussion (Misc queries) 1 November 9th 05 10:31 PM


All times are GMT +1. The time now is 11:38 PM.

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

About Us

"It's about Microsoft Excel"