I have an Excel file with two tabs: Source & Target. Using VBA (Macro), I am attempting to take data in Source and place in Target. The fields are normally manipulating in some form, so not a straight copy and paste. My problem: how do I group rows based on "RuleID" (1st field) and make a decision based on results in "AcctNum" (5th field) and then place results in either DID1 (6th field) or DID2 (7th field)?
See Logic below and in attached file:
If RuleID has a Key = "L" And "R" Then Scen goes in DID1 And DID2 fields.
If RuleID has a Key = "L" And <>= "R" Then Scen goes in DID2 field only.
If RuleID has a Key = "R" And <>= "L" Then Scen goes in DID1 field only.
Scen is determined below:
Dim Type, Dim Scen As String
Type = 1st two characters from left of AcctNum field: =LEFT(AcctNum, 2)
If Type = "QM" Or "CC" Then Scen = "QTOACT"
If Type = "BS" Or "IS" Then Scen = "FTOACT"
Thanks very much for help. I have been going round and round on this issue.
Mike
See Logic below and in attached file:
If RuleID has a Key = "L" And "R" Then Scen goes in DID1 And DID2 fields.
If RuleID has a Key = "L" And <>= "R" Then Scen goes in DID2 field only.
If RuleID has a Key = "R" And <>= "L" Then Scen goes in DID1 field only.
Scen is determined below:
Dim Type, Dim Scen As String
Type = 1st two characters from left of AcctNum field: =LEFT(AcctNum, 2)
If Type = "QM" Or "CC" Then Scen = "QTOACT"
If Type = "BS" Or "IS" Then Scen = "FTOACT"
Thanks very much for help. I have been going round and round on this issue.
Mike
Comment