Skip to main content

Notifications

Community site session details

Community site session details

Session Id : pht8ZY07dleEBzI/aQCa1K
Power Automate - Building Flows
Unanswered

(PAD) How to separate text by semicolon in Excel

Like (0) ShareShare
ReportReport
Posted on 12 Jun 2024 05:05:20 by 45

Hi everyone,

 

I am trying to make a following flow.

I would be grateful if you could give me some advice.

 

-FLOW-

1. Delete all the space

2. Separate text by semicolon into each cell


↓This is the result I would like to get

S140_0-1718168013409.png

  • Robby_WW Profile Picture
    115 on 12 Jun 2024 at 10:22:21
    Re: (PAD) How to separate text by semicolon in Excel

    Hey,

     

    The only way to automatically structure data like that would be with a "run script" (in Excel) action.

     

    function main(workbook: ExcelScript.Workbook) {
    
    	 // Variables
    	let selectedSheet = workbook.getActiveWorksheet();
    	let columnA = selectedSheet.getRange("A:A");
    	let lastrow = columnA.getUsedRange().getRowCount();
    	let range = "A1:A" + lastrow
    	
    	// Replace all " " with "" on column A on selectedSheet
    	columnA.replaceAll(" ", "", {completeMatch: false, matchCase: false});
    
    	// Text to columns on column A on selectedSheet
    	for (let row = 0; row < selectedSheet.getRange(range).getRowCount() ; row++) {
    		let sourceRange = selectedSheet.getRange(range);
    		let destinationRange = selectedSheet.getRange("A1");
    		let sourceRangeValues = sourceRange.getRow(row).getValues()[0][0].toString().split(/[;]/)
    		destinationRange.getOffsetRange(row, 0).getResizedRange(0, sourceRangeValues.length - 1).setValues([sourceRangeValues]);
    	}
    }

     

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 18 Super User 2025 Season 1

#2
stampcoin Profile Picture

stampcoin 14

#3
Churchy Profile Picture

Churchy 12

Overall leaderboard
Loading started