Hi there,
I am trying to highlight each row where a value is present in another list of values (it doesn't need to be in the same order, just needs to be present)
This is a line of code in SAP that highlights the row(s). In this example, it highlights all rows 0-11 (starts at 0 because of a 0 index).
session.findById("wnd[0]/usr/cntlG_CUSTOM_CONTAINER/shellcont/shell[0]").SelectedRows = "0,1,2,3,4,5,6,7,8,9,10,11"
Assuming in this example that all values are present, the selected rows has to equal "0,1,2,3,4,5,6,7,8,9,10,11"
Any thoughts on how to produce code that does this?
Thank you for any thoughts you might be able to provide!
I am trying to highlight each row where a value is present in another list of values (it doesn't need to be in the same order, just needs to be present)
This is a line of code in SAP that highlights the row(s). In this example, it highlights all rows 0-11 (starts at 0 because of a 0 index).
session.findById("wnd[0]/usr/cntlG_CUSTOM_CONTAINER/shellcont/shell[0]").SelectedRows = "0,1,2,3,4,5,6,7,8,9,10,11"
Assuming in this example that all values are present, the selected rows has to equal "0,1,2,3,4,5,6,7,8,9,10,11"
Any thoughts on how to produce code that does this?
- In my attempt, the first loop highlights row 0 (visually speaking, this is row 1 because of the 0 index)
session.findById("wnd[0]/usr/cntlG_CUSTOM_CONTAINER/shellcont/shell[0]").SelectedRows ="0,0,1"
(I'm not sure why it's populating 0 twice, would ideally just be "0,1" but in any case, it seems to be working)
- The second time through the loop, produces session.findById("wnd[0]/usr/cntlG_CUSTOM_CONTAINER/shellcont/shell[0]").SelectedRows ="0,1,2" which is exactly what I would hope to see
- The third time through the loop is where we get lost. It produces session.findById("wnd[0]/usr/cntlG_CUSTOM_CONTAINER/shellcont/shell[0]").SelectedRows ="0,2,3" whereas I would hope to see session.findById("wnd[0]/usr/cntlG_CUSTOM_CONTAINER/shellcont/shell[0]").SelectedRows ="0,1,2,3"
- By the time I reach the final loop, I get session.findById("wnd[0]/usr/cntlG_CUSTOM_CONTAINER/shellcont/shell[0]").SelectedRows ="0,10,11" as opposed to the ideal session.findById("wnd[0]/usr/cntlG_CUSTOM_CONTAINER/shellcont/shell[0]").SelectedRows ="0,1,2,3,4,5,6,7,8,9,10,11"
VBA Code:
overview_A = 0
overview_A_counter = 0
LRow2 = Cells(Rows.count, 10).End(xlUp).offset(4, 0).row
Do While overview_A <> 11
If Cells(LRow2 + overview_A, 10).Value = Cells(8 + overview_A, 10) Then
session.findById("wnd[0]/usr/cntlG_CUSTOM_CONTAINER/shellcont/shell[0]").SelectedRows = overview_A_counter
overview_A_counter = Application.WorksheetFunction.concat("""", 0, ",", overview_A, ",", Application.WorksheetFunction.concat((Application.WorksheetFunction.Sum(overview_A + 1))))
overview_A = overview_A + 1
End If
Loop
Thank you for any thoughts you might be able to provide!