web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Read Highlighted Cells
Power Automate
Unanswered

Read Highlighted Cells

(0) ShareShare
ReportReport
Posted on by 11

When using the Read from Excel worksheet action, I'm able to retrieve all the values within certain column. Is it possible when retrieving the data from the Excel column to only record the cells in the excel sheet that are highlighted instead of everything inside the column?

 

Thanks!

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    The native Excel actions in PAD do not interact with cell formatting in any way. It cannot set highlighting, nor can it "see" it. In order to do something like this, you would need to use scripting, such as PowerShell or VBScript (which can be invoked from a PAD flow). You can either use a script to apply a filter to the file based on cell highlighting, and then use Read from Excel spreadsheet, to retrieve the data when it's filtered, or you can simply use a script to read the data.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @cdschoy 

     

    try this vbs script to get values from highlighted cells in excel directly 

    Option Explicit
    
    ' Define the color you want to search for
    Const COLOR_TO_FIND = 6 ' Yellow color
    
    ' Define the worksheet name
    Const WORKSHEET_NAME = "Sheet1"
    
    ' Create an Excel object
    Dim objExcel
    Set objExcel = CreateObject("Excel.Application")
    
    ' Open the workbook
    Dim objWorkbook
    Set objWorkbook = objExcel.Workbooks.Open("D:\Temp\data.xlsx")
    
    ' Get the worksheet
    Dim objWorksheet
    Set objWorksheet = objWorkbook.Worksheets(WORKSHEET_NAME)
    
    ' Get the used range
    Dim objUsedRange
    Set objUsedRange = objWorksheet.UsedRange
    
    ' Loop through each cell in the used range
    Dim objCell
    For Each objCell In objUsedRange.Cells
     ' Check if the cell has the color we're looking for
     If objCell.Interior.ColorIndex = COLOR_TO_FIND Then
     ' Print the cell address
     WScript.Echo objCell.Value
     End If
    Next
    
    ' Close the workbook
    objWorkbook.Close False
    
    ' Quit Excel
    objExcel.Quit
    

     

    The above script will print values of yellow colored cells in excel worksheet , for a sample sheet like below

    Nived_Nambiar_0-1704989663786.png

     

    Output will be: 

    Nived_Nambiar_1-1704989679171.png

     

    This has to be done using Run VBS script action

    Nived_Nambiar_2-1704989702242.png

     

     

    Note: you have to replace the path mentioned in script (in script is mentioned as D:\Temp\data.xlsx) witn yours and color based on which cells needs to be find by replacing this line of code:

    Const COLOR_TO_FIND = 6

    the number corresponds to which cell color needs to be found out , 

    refer this for color codes: https://www.automateexcel.com/vba/conditional-formatting/

     

    I hope this helps !

     

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 414

#2
11manish Profile Picture

11manish 331 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard