events - VBA worksheet_Change Target range values from dropdownlist -
i've been trying run below worksheet_change code, without luck. not errors, changes not trigger code. below more information:
- actionplan.name referring actual sheet "actionplan"
- the dropdownlist list datavalidation. data feeded sheet in same workbook.
- according locals value2, actionplanrange feeding correct values. values of each cell in column "task type"
option explicit
option base 1
private sub worksheet_change(byval target range) dim actionplanrange range dim tasktypecolumn range dim tasktype range dim actionplantablelastrow long on error goto cleanup application.enableevents = false set actionplanrange = thisworkbook.worksheets("actionplan.name").listobjects("actionplantable").listcolumns("task type").databodyrange if not application.intersect(target, actionplanrange) nothing if target.value <> "one-time" target.offset(0, 1).value = "ongoing" else goto continue end if end if continue: application.enableevents = true exit sub cleanup: msgbox error.description exit sub end sub
Comments
Post a Comment