Balajibenz
Board Regular
- Joined
- Nov 18, 2020
- Messages
- 80
- Office Version
- 2013
- Platform
- Windows
Hi there,
Can you guys help me with below code. what I am trying to do is to split the array in column B which is seperated by commas and then look for each items and if the condition statisfies then it should publish something in column C. I have lot of scenarios with combination of both AND/OR conditions.
at the end if none of scenario is satisfied then in column "C" it should be "not defined".here is the code i have been working on.
below is the sample data.
Can you guys help me with below code. what I am trying to do is to split the array in column B which is seperated by commas and then look for each items and if the condition statisfies then it should publish something in column C. I have lot of scenarios with combination of both AND/OR conditions.
at the end if none of scenario is satisfied then in column "C" it should be "not defined".here is the code i have been working on.
VBA Code:
Sub mapping()
Dim Cl As Range
Dim Dic As Object
Dim Sp As Variant
Dim i As Long
Set Dic = CreateObject("Scripting.dictionary")
With Sheets("Analysis")
For Each Cl In .Range("A2", .Range("A" & Rows.Count).End(xlUp))
Sp = Split(Cl.Offset(, 1).Value, ",")
Select Case Cl.Offset(, 1).Value
Case Is = " "
C1.Offset(, 2).Value = " "
Case Is = "Production"
C1.Offset(, 2).Value = "Prod"
Case Is = "Production" And "Development" Or "Training"
C1.Offset(, 2).Value = "Dev/Prod"
End Select
Next Cl
End With
End Sub
below is the sample data.
ID | Category |
121 | Production |
135 | Production, Development, Staging, Test, Training, UserAcceptanceTest |
283 | Development, Test |
1058 | Production, Test |
148 | UserAcceptanceTest, Development |
1125 | Production, UserAcceptanceTest |
1138 | |