Get Active Cell in Excel Worksheet using Power Automate Desktop
    • Dark
      Light
    • PDF

    Get Active Cell in Excel Worksheet using Power Automate Desktop

    • Dark
      Light
    • PDF

    Article Summary

    #ServerlessTips - Power Automate
    Author: Kent Weare Integration MVP

    As part of the August 2021 release, Microsoft has included a new action in Power Automate Desktop called Get Active Cell in Excel Worksheet. This action is useful when you have people manipulating a spreadsheet, perhaps through a macro, and you want to know where the active cell is. Once you know where the active cell is, you can retrieve it by using the Read from Excel Worksheet action.

    Solution

    1. The first step we need to perform is to open our excel file using the Launch Excel action.
      2-launch

    2. To simulate the behavior of a cell being dynamically selected, I have created a macro that will help us to demonstrate this. We will call this macro from Power Automate Desktop.
      1-excel

    With our macro created in our Excel document, we can call it using the Run Excel macro action.
    3-macro

    1. Our macro will randomly select an active cell within our column. We can subsequently detect which cell is active by using the Get Active Cell in Excel Worksheet action.

    Note: There will be 2 variables produced as outputs that will provide the coordinates of the active cell. We will use these in the next step to read the values.
    4-cell

    1. We can now read our active cell by using the Read from Excel worksheet action and including the two output values that were produced in our prior step. This action will also provide an output. In this case, it will be used to store the value from the cell we are trying to read.
      5-read

    2. We can use a Display message action to validate our process is working correctly.
      6-display(2)

    Testing

    Let’s go ahead and run our process to see what the output is.
    7-testing

    Conclusion

    In this post, we discussed how we can use the new Get Active Cell in Excel Worksheet action to dynamically select the active cell. This feature is useful when you have scenarios that include dynamic data manipulation.

    To see this content in video format, please check out the following YouTube video: Get Active Cell in Excel Worksheet using Power Automate Desktop.


    Was this article helpful?