I'm trying to look for a specific text from my excel file to a SAP table.
I have tried below code but it gives me error "Invalid Next Control variable reference"
So far below is my code:
set rLastRow = rSheet.Cells(rSheet.rows.Count, "AO").End(xlUp).Row
Set Table = session.FindById("wnd[0]/usr/cntlGRID1/shellcont/shell/shellcont[1]/shell")
rows = Table.RowCount - 1
cols = Table.RowCount - 1
Dim columns As Object
Set columns = Table.ColumnOrder
For i = 0 To rows
For j = 2 To rLastRow
If rSheet.Cells(j, "AO").Value = Table.GetCellValue(i, columns(3)) Then
MsgBox "Found!" & rSheet.Cells(j, "AO").Value & Table.GetCellValue(i, columns(3)), vbOKOnly
Else
'proceed to next value to find
End If
Next i
Next j
What I'm trying to do is for each cell in range "AO" in excel, it will look for a match in my GridView (SAP: fbl3n).
Is there another way where can I loop to each cell from range (excel) and look for it in a SAP table (GridView)?