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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to change a specif...
Power Automate
Unanswered

How to change a specific cell in Excel

(0) ShareShare
ReportReport
Posted on by 11

I have an excel sheet stored on Sharepoint and I want to fill in info into a certain cell for example  C5 = value of script

 

How can we do this?

 

 

Categories:
I have the same question (0)
  • Verified answer
    DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @aralvesbe 

     

    With update a row you can select the column and value as a reference and then update any of the columns within that row.

     

    DamoBird365_0-1615452991178.png

     

    DamoBird365_1-1615453005400.png

     

    This would update row 3, Dave to New Value

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Cheers,
    Damien

     

  • GeoffRen Profile Picture
    Microsoft Employee on at

    Keep in mind that if you want to do this without using tables, you will have to use Office Scripts (specifically Office Scripts with Power Automate)? This is the 'Run Script' action on the Excel connector. With Office Scripts you can use the 'Run Script' action to execute javascript against a workbook. So, in your case, you would have a script that just assigns the value of a cell a parameter. So something like

     
    async function main(workbook: ExcelScript.Workbook, val: string) {
      workbook.getWorksheet('Sheet1').getRange('C5').setValue(val);
    }

     

  • ZKBPCE-IT Profile Picture
    19 on at

    Hello @GeoffRen
    I think you can help me with my problem, i have an excel file that i duplicate evrey month, then i have to update a cell with the value of the first day of the last month. I tried to do this with the action "Update a row" in power automate, but it take more than 6min to update one cell. do you know others way fater to update a cell, maybe with the excel scripts ?
    thanks in advance for your response 

  • GeoffRen Profile Picture
    Microsoft Employee on at

    The following script will do what you want. 

    function main(workbook: ExcelScript.Workbook) {
     // Standard javascript date object operations to get the name of the previous month
     // I searched on google: 'js get previous month', found this site https://reactgo.com/javascript-get-previous-month-name/ and shamelessly repurposed it for the following
     const current = new Date();
     current.setMonth(current.getMonth() - 1);
     const previousMonth = current.toLocaleString('default', { month: 'long' });
    
     // Set 'previousMonth' as the value in some range in some worksheet
     workbook.getWorksheet("Sheet5").getRange("A1").setValue(previousMonth);
    }

     Output:

    GeoffRen_0-1677176893486.png

     

     

  • Community Power Platform Member Profile Picture
    on at

    I keep getting this: 

      "Message""The request entity's media type 'text/plain' is not supported for this resource.\r\nclientRequestId: f7af027b-fa0c-439e-833e-2bd61b94cb0b". 
    Artemis22_0-1690463905131.png

    Here's what I put down as my script:

    Artemis22_2-1690464072263.png

     

     

  • GeoffRen Profile Picture
    Microsoft Employee on at

    Please take a look at these tutorials.

    Office Script basics

    Office Script Power Automate

    You need to create an Office Script and then use the Office Script here. Hardcoded scripts here are not supported.

  • Community Power Platform Member Profile Picture
    on at

    I was able to do what I wanted with update rows instead. I didn't understand it before but I found something that was helpful. 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard