Wishmaster89
Board Regular
- Joined
- Jan 10, 2022
- Messages
- 77
- Office Version
- 2021
- 2019
- 2016
- Platform
- Windows
- MacOS
Hi Everyone
I have a conditional drop down list where a user can choose a course and a pathway which works fine.
The problem is one of the courses (IT) has an additional drop down list (column c), the problem is when the course in the first column is changed ( changed to Maths for example) column c is not clearing.
This is the VBA code i have that clears column B if column A changes.
I have a conditional drop down list where a user can choose a course and a pathway which works fine.
The problem is one of the courses (IT) has an additional drop down list (column c), the problem is when the course in the first column is changed ( changed to Maths for example) column c is not clearing.
This is the VBA code i have that clears column B if column A changes.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Not Intersect(Target, Range("A4:B18")) Is Nothing Then Target.Offset(columnoffset:=1).ClearContents
Application.EnableEvents = True
End Sub
drop down list offset example.xlsm | |||||
---|---|---|---|---|---|
A | B | C | |||
2 | Course | Pathway | If course is IT choose additional pathway | ||
3 | Pathway Selection | ||||
4 | IT | Access database | VBA | ||
5 | |||||
6 | |||||
7 | |||||
8 | |||||
9 | |||||
10 | |||||
11 | |||||
12 | |||||
13 | |||||
14 | |||||
15 | |||||
16 | |||||
17 | |||||
18 | |||||
Course selection |
Cells with Conditional Formatting | ||||
---|---|---|---|---|
Cell | Condition | Cell Format | Stop If True | |
B4:C18 | Expression | =ISBLANK(XEL4) | text | NO |
A4:C18 | Expression | =ISBLANK(A4) | text | NO |
A4:C18 | Expression | =ISBLANK(A4) | text | NO |
A4:C4 | Expression | =ISBLANK(A4) | text | NO |
A4:C4 | Expression | =ISBLANK | text | NO |
A4:A18 | Expression | =ISBLANK(XEJ4) | text | NO |
Cells with Data Validation | ||
---|---|---|
Cell | Allow | Criteria |
A4:A18 | List | =CourseList!$B$1:$E$1 |
B4:B18 | List | =OFFSET(CourseList!$B$1,1,MATCH(A4,CourseList!$B$1:$E$1,0)-1,5,) |
C4 | List | =IF(C4="",OFFSET(CourseList!$M$1,1,MATCH(A4,CourseList!$M$1:$M$1,0)-1,5,),INDIRECT("FakeRange")) |
C5:C18 | List | =IF(A5<>"IT","",OFFSET(CourseList!$M$1,1,MATCH(A5,CourseList!$M$1:$M$1,0)-1,5,)) |