TheWennerWoman
Active Member
- Joined
- Aug 1, 2019
- Messages
- 303
- Office Version
- 365
- Platform
- Windows
I have the following (courtesy of one of you kind people) that works perfectly
So this populates an array with values from column B. Perfect.
However, I now need to amend this code so that it picks up column B, adds " | " and then column I.
So currently it might be populating the array with "C1234" but after it would be "C1234 | Training" for example.
The values in column B + I are always consistent for the value in column B (so for each C1234 in column B, it would always be Training in column I, it would never be C1234 and HR).
Is the code above modifiable or am I better off amending the source data prior to populating the array?
VBA Code:
Dim d As Object, r As Range, c, a, i As Long
Set d = CreateObject("scripting.dictionary")
For Each r In ws1.Range("B3", ws1.Cells(Rows.Count, "B").End(xlUp))
For Each c In Split(r, ",")
d(c) = 1
Next c
Next r
a = Application.Transpose(d.keys)
So this populates an array with values from column B. Perfect.
However, I now need to amend this code so that it picks up column B, adds " | " and then column I.
So currently it might be populating the array with "C1234" but after it would be "C1234 | Training" for example.
The values in column B + I are always consistent for the value in column B (so for each C1234 in column B, it would always be Training in column I, it would never be C1234 and HR).
Is the code above modifiable or am I better off amending the source data prior to populating the array?