excel - Macro for hiding values in a Data Validation list based on value selected from another Data Validation list -
i need help in writing macro displaying unique values in next column (for suppose b column) should in list format, based on value selected info validation list (for suppose, in column).
i want more specific providing info using macro, still beginner in writing these macros, appreciate help.
process definition
process planning
new process initiatives
amendment of existing process
qms feedback received stakeholders
analysis of feedback received
process reviews
process roll-out activities
process piloting
process integration workshops
new process trainings
process implementation
facilitation back upwards functions
audit management
audit scheduling
execution. coordinating , conducting audits
audit study preparation , support
corrective action , preventive action - followup
audit status update
audit analysis
audit closure
metrics
metrics collation facilitation
metrics collection project , support
metrics analysis project , support
management review
mrm scheduling
mrm presentation preparation
pre-mrm
coordinating , conducting management review
action items followups
process training
orientation training
internal auditor training
process training
so want create info validation list in column b 'b4:b25' headings given in bold above , info validation list in column c 'c4:c5' respective info below each heading. if select "process definition" 'b4' dv list, want info below heading1 i.e., "process planning,new process initiatives..... , on" displayed in info validation list in 'c4'.
thanks in advance. cheers.
considering have dropdown nowadays in column values "a" & "b", utilize workbook_sheetchange event in vba populate value in column b based on value select in column a:
e.g.
private sub workbook_sheetchange(byval sh object, byval target range) if target.column = 1 'to run when value changed in column cells(target.row, 2).select cells(target.row, 2).value = "" 'initializes value of dependent dropdown blank if target.value = "a" 'add 1,2,3,4 dependent dropdown if value of column "a" selection.validation .delete .add type:=xlvalidatelist, alertstyle:=xlvalidalertstop, operator:=xlbetween, formula1:="1,2,3,4" 'change 1,2,3,4 values need .ignoreblank = false .incelldropdown = true .showinput = true .showerror = true end elseif target.value = "b" 'add 1,2,3,4 dependent dropdown if value of column "b" selection.validation .delete .add type:=xlvalidatelist, alertstyle:=xlvalidalertstop, operator:=xlbetween, formula1:="5,6,7,8" 'change 5,6,7,8 values need b .ignoreblank = false .incelldropdown = true .showinput = true .showerror = true end else exit sub end if end if end sub
edit: needed alter target value(target.value
) , values in formula1
given in code require. able help you:
if target.value = "process definition" 'create dependent dropdown when value of column "process definition" selection.validation .delete .add type:=xlvalidatelist, alertstyle:=xlvalidalertstop, operator:=xlbetween, formula1:="process planning,new process initiatives,amendment of existing process, , on.." .ignoreblank = false .incelldropdown = true .showinput = true .showerror = true end elseif target.value = "process implementation" 'create dependent dropdown when value of column "process implementation" selection.validation .delete .add type:=xlvalidatelist, alertstyle:=xlvalidalertstop, operator:=xlbetween, formula1:="facilitation back upwards functions" .ignoreblank = false .incelldropdown = true .showinput = true .showerror = true end elseif target.value = "audit management" 'create dependent dropdown when value of column "audit management" selection.validation <similar code above> end elseif...and on.. else exit sub end if
you can create first dropdown (process definition,process implementation,audit management etc.) using info validation alternative in info tab of excel or using vba code (documentations both available on internet). can refer axel richter's link same well.
excel vba validation excel-vba
No comments:
Post a Comment