RockandGrohl
Well-known Member
- Joined
- Aug 1, 2018
- Messages
- 801
- Office Version
- 365
- Platform
- Windows
Hi all,
I'm declaring my source as "src" and my discount as "dis"
src will always be a value, but dis can either be a value or blank.
An example will be src = NQS and dis = "", or src = NQS and dis = NQS20
My code is below:
In that first example, what happens is it detects the src matches the initial set of cases as NQS is in that list. Then it goes to select case dis and shows it can be either blank or one of the same codes with a wildcard after.
What happens is even though src = NQS and dis = "", it goes to "Case Else" and puts a "N" in column AE.
This needs to be a Y because the logic is src = list and disc = list or blank.
Thanks!
I'm declaring my source as "src" and my discount as "dis"
src will always be a value, but dis can either be a value or blank.
An example will be src = NQS and dis = "", or src = NQS and dis = NQS20
My code is below:
Code:
src = Cells(ActiveCell.Row, "F").Valuedis = Cells(ActiveCell.Row, "G").Value
Select Case src
'Attribution Model 1
Case src Like "ARC", "BAC", "ICP", "IPRT", "JGRT", "KMG", "NAD", "NQS", "OMRT", "OSG*", "RCH", "ROPJG", "RTSUP", "SUP", "TIN*", "TLA*", "TRN", "WPR*"
Select Case dis
Case dis Like "", "ARC*", "BAC*", "ICP*", "IPRT*", "JGRT*", "KMG*", "NAD*", "NQS*", "OMRT*", "OSG*", "RCH*", "ROPJG*", "RTSUP*", "SUP*", "TIN*", "TLA*", "TRN*", "WPR*"
Cells(ActiveCell.Row, "AE").Value = "Y"
Case Else
'Attribution Model 2
Cells(ActiveCell.Row, "AE").Value = "N"
End Select
End Select
In that first example, what happens is it detects the src matches the initial set of cases as NQS is in that list. Then it goes to select case dis and shows it can be either blank or one of the same codes with a wildcard after.
What happens is even though src = NQS and dis = "", it goes to "Case Else" and puts a "N" in column AE.
This needs to be a Y because the logic is src = list and disc = list or blank.
Thanks!