To Check highlighted cell matches with another cell in excel

Hi Team,

I am performing automation related to excel. Please provide suggestion for the below mentioned scenario.

Double click on the K cell value which will highlight value in G (Screenshot attached).

I need to check for that specific row that is Z column which is Sea that should be matched with the respective highlighted cell.

The same operation needs to be performed for every row item.

Note - If Z column contains AIR then in G column should be highlighted against AIR else it should throw exception

Kindly advise how to automate this scenario.

Thanks in advance.

@Lahiru.Fernando @Palaniyappan

Excel Application Scope
Read Range → Save to DataTable

For Each Row in DataTable
Get Cell Color of column ‘G’ → Save as colorVariable
If (row(“Z”).ToString = “SEA” AndAlso colorVariable = expectedColorForSEA) OrElse
(row(“Z”).ToString = “AIR” AndAlso colorVariable = expectedColorForAIR) Then
// Valid case, move to next row
Else
// Throw an exception or log the mismatch
End If
Next Row

Hi ,

Thanks for the reply. To get the cell color I need to double click in the filtered cell.
How this can be done? If Ui automation or any other alternate solution for this.