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 / Extract excel sheet na...
Power Automate
Unanswered

Extract excel sheet name from get all excel worksheets.

(0) ShareShare
ReportReport
Posted on by 3

Hello Team,

Please provide solution for , How to extract the name of an Excel worksheet from a list of all Excel worksheets and paste the data into a specific worksheet?

I have the same question (0)
  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    The Get all Excel worksheets action will return a list of worksheet names stored in %SheetNames%.

    Getting a specific value from the list can be accomplished by using an index. Please note that indexes are 0-based in PAD, so, the first sheet name in the list can be retrieved by using the index 0, the second - by index 1, etc.

    So, if you want to write the name of the first sheet somewhere, you should write %SheetNames[0]%.

     

    If you want to write them all, you can use a For each loop and then write the %CurrentItem%, which is a variable created by the For each loop that stores the value of the current iteration.

     

    For example, if you wanted to write the name of each sheet into cell A1 of each sheet, you could do the following:

    1. Launch Excel to open the document
    2. Get all Excel worksheets
    3. For each worksheet in %SheetNames%, store the current item into %CurrentItem%
      1. Set active Excel worksheet using %CurrentItem% as the Name of the sheet
      2. Write to Excel worksheet writing %CurrentItem% into row 1 column A
    4. Close Excel saving the file

    -------------------------------------------------------------------------
    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.

  • urmilapatil54 Profile Picture
    3 on at

    There are ten worksheets in my Excel, and I want to paste new data onto the seventh worksheet.

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    You do not need to get the sheet names to do that. Simply use the Set active Excel worksheet and use the index to activate the sheet. In this case the index is 1-based, su use 7 if you want the 7th sheet.

    -------------------------------------------------------------------------

    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.

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

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 442

#2
Vish WR Profile Picture

Vish WR 328

#3
David_MA Profile Picture

David_MA 268 Super User 2026 Season 1

Last 30 days Overall leaderboard