dj44
06-12-2018, 03:52 AM
Hi folks,
Can some one please be able to advise on how I may use an exclude array to exclude items in my transpose array
Sub Transpose_Array()
Dim oWs As Worksheet
Set oWs = ThisWorkbook.Worksheets("Test")
oExclude = oArray = Array("Hello", "Car","Mobile")
For i = LBound(oExclude) To UBound(oExclude)
With oWs
LastRow = .Cells(Rows.Count, "A").End(xlUp).Row
.Range("A1:A" & LastRow).Select
End With
oWs.Range("B1") = Join(Filter(Application.Transpose(Selection), oExclude(i), True))
Next i
End Sub
I usually exlude one term at a time but I think an array can hold my exclude terms?
Can some one please be able to advise on how I may use an exclude array to exclude items in my transpose array
Sub Transpose_Array()
Dim oWs As Worksheet
Set oWs = ThisWorkbook.Worksheets("Test")
oExclude = oArray = Array("Hello", "Car","Mobile")
For i = LBound(oExclude) To UBound(oExclude)
With oWs
LastRow = .Cells(Rows.Count, "A").End(xlUp).Row
.Range("A1:A" & LastRow).Select
End With
oWs.Range("B1") = Join(Filter(Application.Transpose(Selection), oExclude(i), True))
Next i
End Sub
I usually exlude one term at a time but I think an array can hold my exclude terms?