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 / Update the mastersheet
Power Automate
Unanswered

Update the mastersheet

(0) ShareShare
ReportReport
Posted on by 14

I have a Master sheet file, and I have sheets 1 to 6 Which contain data I need to populate into the master sheet file. 

Rows 6 to 99 from sheet one will be copied to rows 6 to 99 in the master sheet.

Rows 100 to 300 from sheet 2 will be copied to rows 100 to 400 in the master sheet, etc.

VB is disabled in my organization.

How can I update the master sheet according to the data that are entered in sheets 2 to 6?

Screenshot 2024-03-21 094022.jpg

Categories:
I have the same question (0)
  • Andrew_J Profile Picture
    1,962 Moderator on at

    @Dyrock 

     

    Would Office scripts work for you.

     

    Regards,

     

    Andrew

  • Dyrock Profile Picture
    14 on at

    How can I convert this VB macro to Office script?

    function main(workbook: ExcelScript.Workbook) {
    // Delete the "Combined" worksheet, if it's present.
    workbook.getWorksheet('Combined')?.delete();

    // Create a new worksheet named "Combined" for the combined table.
    const newSheet = workbook.addWorksheet('Combined');

    // Get the header values for the first table in the workbook.
    // This also saves the table list before we add the new, combined table.
    const tables = workbook.getTables();
    const headerValues = tables[0].getHeaderRowRange().getTexts();
    console.log(headerValues);

    // Copy the headers on a new worksheet to an equal-sized range.
    const targetRange = newSheet.getRange('A1').getResizedRange(headerValues.length-1, headerValues[0].length-1);
    targetRange.setValues(headerValues);

    // Add the data from each table in the workbook to the new table.
    const combinedTable = newSheet.addTable(targetRange.getAddress(), true);
    for (let table of tables) {
    let dataValues = table.getRangeBetweenHeaderAndTotal().getTexts();
    let rowCount = table.getRowCount();

    // If the table is not empty, add its rows to the combined table.
    if (rowCount > 0) {
    combinedTable.addRows(-1, dataValues);
    }
    }
    }

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

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard