Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I'm programming VB in Excel. I've created a series of simple lists in a worksheet. I would like to select one object from list 1 in a cell in column A and then have the cursor cell move to the right neighbouring cell and present me with a dropdown menu showing the contents of another list dependant on what was chosen in the first cell. Here's the code so far: Code: -------------------- Sub Dropdownlist() Dim cell As Variant If (Range("A40:A4000").Select) Then cell = ActiveCell.Address Select Case (ActiveCell.FormulaR1C1) Case "1. Tooling" Range("B40").Select With Selection.Validation .Delete .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _ xlBetween, Formula1:="=$B$1:$B$11" .IgnoreBlank = True .InCellDropdown = True .InputTitle = "" .ErrorTitle = "" .InputMessage = "" .ErrorMessage = "" .ShowInput = True .ShowError = True End With Case "2. Project Organisation" Range("B40").Select With Selection.Validation .Delete .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _ xlBetween, Formula1:="=$C$1:$C$11" .IgnoreBlank = True .InCellDropdown = True .InputTitle = "" .ErrorTitle = "" .InputMessage = "" .ErrorMessage = "" .ShowInput = True .ShowError = True End With End Select End If End Sub -------------------- The problem is - how do I get the variable "cell" to move to the right one cell? If I add "+1" I get the value $A$401 instead of $A$41 as I would like Many thanks for any help. -- karambos ------------------------------------------------------------------------ karambos's Profile: http://www.excelforum.com/member.php...o&userid=16262 View this thread: http://www.excelforum.com/showthread...hreadid=276632 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Populating a Data Validation List | Excel Discussion (Misc queries) | |||
How do I show a value for selected text from a dropdown list? | Excel Discussion (Misc queries) | |||
return a data list depending on a value selected within a drop dow | Excel Discussion (Misc queries) | |||
Populating a dropdown list with an Array | Excel Programming | |||
Changing cell value depending on dropdown list | Excel Programming |