I'm trying to access the values in C(Number):D(Number) inside the filtered list, however I seem to be doing something wrong because the MsgBox never shows up.
'Filter only numeric values
With MaterialListSheet
.AutoFilterMode = False
.Range("B1").AutoFilter Field:=1, Criteria1:="0*"
End With
Set rangeInventory = InventorySheet.Range("N1:N" & Rows.Count)
' I had Set rangeMaterialList = MaterialListSheet.Range("B1:B" & Rows.Count) in the beginning but I realized If I need C and D i'm only selecting B
Set rangeMaterialList = MaterialListSheet.Range("B1:F" & Rows.Count)
For Each CellML In rangeMaterialList.SpecialCells(xlCellTypeVisible)
BomCodesToSplit = CellML.Range("C" & Rows.Row & ":D" & Rows.Row).Values
MsgBox BomCodesToSplit
For Each CellI In rangeInventory.SpecialCells(xlCellTypeVisible)
Next CellI
Next CellML
Tried this but no luck:
BomCodesToSplit = MaterialListSheet.Range("C" & Rows.Row & ":D" & Rows.Row).Values
I'd like to select
C1:D1
C2:D2
C3:D3
.
.
.
Meaning something like this so it selects it depending on the loop index
Cn:Dn
In some other programming languages I would use the index of the loop but since I'm new to VBA I have no idea how to do this.
How to achieve this?