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 / Adding text to all Exc...
Power Automate
Unanswered

Adding text to all Excel rows in a column

(0) ShareShare
ReportReport
Posted on by 138

Hi

 

I am using Loops 'For each' to add the same text to each excel row in a given column but as there are many rows loops 'for each' takes quite some time.

Is there a quick method to write to excel via List or Datatable?

If so how?

I have the same question (0)
  • VJR Profile Picture
    7,635 on at

    HI @garthh 

    In the Write to Excel action you can directly pass a List or a Datatable and it will write its entire contents to the specified cell.

  • Kaif_Siddique Profile Picture
    2,108 Super User 2024 Season 1 on at

    Hi @garthh ,

     

    Here is another possible solution. Use excel as database and run SQL query. SQL queries can retrieve and manipulate significant amounts of Excel data more efficiently.

     

    Kaif_Siddique_0-1663439922195.png

    Connection String:

    Provider=Microsoft.ACE.OLEDB.12.0;Data Source=<<File Path>>;Extended Properties="Excel 12.0 Xml;HDR=YES";

     

    Want to learn how to Run SQL queries on Excel files. Refer below link

    https://learn.microsoft.com/en-us/power-automate/desktop-flows/how-to/sql-queries-excel

     

    Let me know if any queries.

     

    If you like my response, please give it a Thumbs Up.
    If this helps, please Accept as solution.

     

    Regards

    Kaif

  • garthh Profile Picture
    138 on at

    VJR

    Thanks, I'm not that advanced! The number of rows vary each time a spreadsheet is made, how can a list be made to fit the rows?

  • garthh Profile Picture
    138 on at

    Kaif

    Thank you

    Perhaps beyond my level, but I will take a look

  • VJR Profile Picture
    7,635 on at

    Hi @garthh 

     

    In the original post it said "Is there a quick method to write to excel via List or Datatable?"

    For this use the "Write to Excel worksheet" action. You dont have to worry about how many rows the list or datatable has. All the rows of the list/datatable will be written to those many rows of the Excel sheet.

     

    But now I think you are asking "how can a list be made to fit the rows?"

    "The number of rows vary each time a spreadsheet is made"

    "Get first free column/row from Excel worksheet" will give you the total number of rows on a sheet but I am not clear why do you need this when you are writing a list or a datatable to a sheet.

     

     

     

  • Kaif_Siddique Profile Picture
    2,108 Super User 2024 Season 1 on at

    Let me know if that works for you or have any queries. 

  • garthh Profile Picture
    138 on at

    VJR

    Thanks. Yes I understand "Get first free column/row from Excel worksheet" 

    However Write to Excel doesn't provide from/to row parameters?

    Theworksheet is a utility that writes to an ERP SQL database. All columns need to have the same number of rows. The other columns are entered by copy and paste from other worksheets

    The column causing the issue needs a P in each row based on the row values pasted into other rows 

    garthh_2-1663709835098.png

     

  • garthh Profile Picture
    138 on at

    VJR

    Thanks. Yes I understand "Get first free column/row from Excel worksheet" 

    However Write to Excel doesn't provide from/to row parameters?

    Theworksheet is a utility that writes to an ERP SQL database. All columns need to have the same number of rows. The other columns are entered by copy and paste from other worksheets

    The column causing the issue needs a P in each row based on the row values pasted into other rows 

    garthh_2-1663709835098.png

     

  • garthh Profile Picture
    138 on at

    Kaif, thanks

    How are the number of rows determined? From/to

    The worksheet is a utility that writes to an ERP SQL database and all columns must have the same number of rows

    The rows are 9 to "Get first free column/row from Excel worksheet" 

    Where can they be set in your suggestion?

     

  • VJR Profile Picture
    7,635 on at

    Hi @garthh 

    There is no directly available action to write something into multiple rows, without making use of loops.

    However you can check the below post for copy pasting to multiple cells. 

     

    https://powerusers.microsoft.com/t5/Power-Automate-Desktop/FILLING-DOWN/m-p/1650425/highlight/true#M15639

     

    Bascially, it as about writing P to the first cell only and then pasting it to the desired range of cells.

    VJR_0-1663735314189.png

     

     

     

     

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 262 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 167

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard