Hi All,
I have the code below:
The highlighted line of code suppose to assign the specified range of values as a one dimensional array using the row values in the range but it is creating arrays from the horizontal values. i.e. instead of a x rows by 1 column dimension, I am have 1 row by x column dimension and strictly multi-direction instead of one dimensional
Need help to resolve this.
I have the code below:
Code:
Sub CodeCleanUP()
Dim Src As Worksheet, Dst As Worksheet, Code As Worksheet
Set Src = Worksheets("SBBillingExport"): Set Dst = Worksheets("CurrentServices"): Set Code = Worksheets("Codes")
Src.Activate
Dim CodesInspected() As Variant
'Initialize Codes
Dim Code01() As Variant
[COLOR=#b22222]Code01() = Code.Range(Code.Cells(3, 1), Code.Cells(Code.Cells(Rows.Count, 1).End(xlUp).Row, 1))[/COLOR]
RCount = Src.Cells(Rows.Count, 1).End(xlUp).Row
Src.Columns("R:R").Delete Shift:=xlToLeft
Src.Range("B1:B" & RCount).AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Src.Range("R1"), Unique:=True
Clients = Src.Cells(Rows.Count, 18).End(xlUp).Row
Src.Cells(2, 18).Resize(Clients - 1, 1).Copy Dst.Cells(2, 1)
For i = 2 To Clients
ClientID = Src.Cells(i, 18)
Src.Range("A1:P" & RCount).AutoFilter
Src.Range("$A$1:$P" & RCount).AutoFilter Field:=2, Criteria1:=ClientID
'StartProc = GetFilteredRangeTopRow
'EndPRoc = GetFilteredRangeBottomRow
Dst.Cells(i, 1) = ClientID
For j = StartProc To EndPRoc
Dst.Cells(i, 2) = Src.Cells(j, 4)
'NextRow = Dst.Cells(Rows.Count, 2).End(xlUp).Row
For k = LBound(Code01) To UBound(Code01)
If Trim(Code01(k, 1)) = Left(Src.Cells(j, 10), 6) Then
Dst.Cells(i, 3) = "Yes"
End If
Next k
Next j
Next i
Src.Range("A1:P" & RCount).AutoFilter
End Sub
Need help to resolve this.
Last edited: