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 / Paste value into an ex...
Power Automate
Unanswered

Paste value into an excel range

(0) ShareShare
ReportReport
Posted on by 9

Hi everyone,

 

I am stumped on this flow.

 

Essentially I have a variable that has a value, lets say the value is "Green"

I need to paste this value into a specific range, lets say into the range of B2:B10

 

I know of the actions Paste cells to Excel worksheet and Write to Excel worksheet, but these actions don't seem to give me an option to paste/write into a range of cells.

 

Can anyone advise? I did catch that the mentioned actions above allow me to select a "Paste mode" on named cells, which to me indicates they can accommodating pasting into ranges, but I also can't figure out on how I can create a variable that houses the named range of "B2:B10"

Categories:
I have the same question (0)
  • Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at

    Hi @JoshuaBa 

     

    I think writing office scripts in excel and then executing same via excel actions in power automate would be good option. see below

    .

    Write a office script which would populate the given value in given range. like below

    Nived_Nambiar_0-1711651465791.png

     

    Office script - 

    function main(workbook: ExcelScript.Workbook,excelrange: string,excelvalue: string,sheetname: string) {
     let sheet = workbook.getWorksheet(sheetname);
     sheet.activate();
    
     // Set the value "Green" in the range A1:B10
     let rangeA1B10 = sheet.getRange(excelrange);
     rangeA1B10.setValue(excelvalue);
    }
    

     

    Now use the below action to run the reuslts 

    Nived_Nambiar_1-1711651528683.png

     

    And u see the below result

    Nived_Nambiar_2-1711651546145.png

     

     

    Hope it 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! 🙌

  • JoshuaBa Profile Picture
    9 on at

    Hi Nived,

    Thanks for the walk-thru - is there anyway that this can be done through only Power Automate?

    I do not know how to code, and find Power Automate's no-code flows make it easier for myself and our team to make adjustments on the fly.

  • Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at

    Hi @JoshuaBa 

     

    via power automate desktop > it would be possible as writing as cell value is possible there which is not possible in case of power automate cloud flow directly with actions.

     

    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! 🙌

  • JoshuaBa Profile Picture
    9 on at

    Yes, I am referring to Power Automate desktop (I have no clue on how to use the cloud version)

     

    IT is weird how you can read from a range of cells, but I can't see how I can write to a range of cells

  • Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at

    Hi @JoshuaBa 

     

    Sorry i thought you were reffering the cloud flow. For desktop flow, you can design a datatable which stores the values and then write it to excel file. see below

    Nived_Nambiar_0-1711692332853.png

     

    SET dt1 TO { ^['Column1'] }
    LOOP LoopIndex FROM 1 TO 10 STEP 1
     SET dt1 TO dt1 + ['Green']
    END
    Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: $'''D:\\Temp\\data.xlsx''' Visible: True ReadOnly: False Instance=> ExcelInstance
    Excel.WriteToExcel.WriteCell Instance: ExcelInstance Value: dt1 Column: $'''B''' Row: 1
    Excel.CloseExcel.CloseAndSave Instance: ExcelInstance
    

     

    And see the result - 

    Nived_Nambiar_1-1711692365514.png

     

     

    and based on requirements - u have to adjust code accordingly.

     

    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

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 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard