Hello there
I have tried to make an array and then I want to delete some of the elements. But the problem is that, UBound i still the same after deleting. How can I fix that?
Cause I need it to be pasted to A1 and then to D1 (cause I deleted two letters, If I don't delete some letters then it should be to F1).
So it could look like:
A B C D E F
And then I want to put some vlookup under every letter just for 10 down.
B C E F
Vlookup Vlookup Vlookup Vlookup
Vlookup Vlookup Vlookup Vlookup
Vlookup Vlookup Vlookup Vlookup
Vlookup Vlookup Vlookup Vlookup
Vlookup Vlookup Vlookup Vlookup
Vlookup Vlookup Vlookup Vlookup
Vlookup Vlookup Vlookup Vlookup
Vlookup Vlookup Vlookup Vlookup
Vlookup Vlookup Vlookup Vlookup
Vlookup Vlookup Vlookup Vlookup
The vlookup should I made like formula VBA.
Some there can see what I'm doing wrong?
Hope you can understand my bad English. Have a great night!
I have tried to make an array and then I want to delete some of the elements. But the problem is that, UBound i still the same after deleting. How can I fix that?
Cause I need it to be pasted to A1 and then to D1 (cause I deleted two letters, If I don't delete some letters then it should be to F1).
So it could look like:
A B C D E F
And then I want to put some vlookup under every letter just for 10 down.
B C E F
Vlookup Vlookup Vlookup Vlookup
Vlookup Vlookup Vlookup Vlookup
Vlookup Vlookup Vlookup Vlookup
Vlookup Vlookup Vlookup Vlookup
Vlookup Vlookup Vlookup Vlookup
Vlookup Vlookup Vlookup Vlookup
Vlookup Vlookup Vlookup Vlookup
Vlookup Vlookup Vlookup Vlookup
Vlookup Vlookup Vlookup Vlookup
Vlookup Vlookup Vlookup Vlookup
The vlookup should I made like formula VBA.
Some there can see what I'm doing wrong?
Hope you can understand my bad English. Have a great night!
VBA Code:
Function MyArray()
Dim arr, arr2
arr = Array("A", "B", "C", "D", "E", "F")
Dim c As Long: c = 0
Dim j As Long, jj As Long: jj = 1
ReDim arr2(1 To UBound(arr), 1 To UBound(arr, 2))
For j = 1 To UBound(arr)
If arr(j, 1) <> "A" And arr(j, 1) <> "D" Then
arr2(jj, 1) = arr(j, 1)
jj = jj + 1
c = c + 1
End If
Next j
ReDim Preserve arr2(c)
MyArray = arr2
End Function