Afro_Cookie
Board Regular
- Joined
- Mar 17, 2020
- Messages
- 103
- Office Version
- 365
- Platform
- Windows
I am starting a defect log that will catalogue multiple item classes (4 so far) and I want to group their part numbers into a single column.
I can write a nested If statement that will do the calculations I need to pull data from other reference files, but it's ugly and if someone messes with the code, it will affect a lot of data.
Is there a way in VBA to write a statement that will pull relevant data from different files, depending on the value in a single column?
Examples
I can write a nested If statement that will do the calculations I need to pull data from other reference files, but it's ugly and if someone messes with the code, it will affect a lot of data.
Is there a way in VBA to write a statement that will pull relevant data from different files, depending on the value in a single column?
Examples
VBA Code:
=IF(COUNTIF(C2,"L*"),"YES",XLOOKUP($C2,'database'!$A$1:$A$65536,'database'!$Q$1:$Q$65536))
Date | Formula | Item # |
1-Jan-22 | 2108009C | 26440721 |
2-Jan-22 | YES | LAB12645 |
3-Jan-22 | YES | LAB12345 |
4-Jan-22 | 2106011C | 26393028 |