Livin404
Well-known Member
- Joined
- Jan 7, 2019
- Messages
- 743
- Office Version
- 365
- 2019
- Platform
- Windows
Greetings, I am able to insert text in one cells based on the value of another cell. With help we got it to work with Wildcards. Now that I am search for a code were a wildcard in my case two wildcard position can be a number of Multiple characters. I believe I'm going to need something like an array.
My code I know will be something similar to:
I know the array portion needs attention. The first character can be anything, it is the 2 and 3 character I need to be limited to the options I identified.
Thank you,
My code I know will be something similar to:
VBA Code:
Sub CHANNEL_MSN()
Dim i As Long
For i = 1 To Cells(Rows.Count, 1).End(xlUp).Row
If Left(Cells(i, 1).Value, 2) Like "***" And Left(Cells(i, 1).Value, 2) = Array("F", "M", "P", "J", "V", "L") Then
If Left(Cells(i, 1).Value, 3) Like "***" And Left(Cells(i, 1).Value, 3) = Array("X", "J", "R", "U", "W", "Y", "Z", "E", "Q", "F") Then
If ActiveSheet.Range("G" & i) = "" Then
ActiveSheet.Range("G" & i) = "CHANNEL"
Else
ActiveSheet.Range("G" & i) = ActiveSheet.Range("G" & i) & "/CHANNEL"
End If
End If
Next i
End Sub
I know the array portion needs attention. The first character can be anything, it is the 2 and 3 character I need to be limited to the options I identified.
Thank you,