cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lisha
Helper II
Helper II

undefined

How to replace space with underscore from columns name in excel file in power automate desktop?

4 REPLIES 4
MichaelAnnis
Super User
Super User

I would do this in Excel. It will be much more efficient than trying to do it cell by cell with pad.

 

You can use the recorder feature to try and get the windows UI elements, or another option would be to use hot keys which you can manage through the Send Keys command. 

lisha
Helper II
Helper II

No, but the condition is not to use recorder or UI elements in the flow. So have to do it by other actions.

Then use Send Keys. Do it manually to find out, but for example, {Alt}(fo) would be file open. So, manually go to excel, press the Alt key, and you will see a bunch of letters pop up. Use those letters to navigate the ribbon to Home > Find & Replace > Replace. Then use Tab keys and inputs to get through the dialogue and you should be done. 

August update brings a new 'Find and replace cells in Excel worksheet' action, but it doesn't work in a specific range of cells.

Try this:
1. 'Launch Excel' with you file
2. 'Focus windows', window class = XLMAIN
3. 'Select cells in Excel worksheet' and select your column headers
4. 'Send keys' {LControlKey}({U}) 'Ctrl + u: replace shortcut
5. 'Send keys' {Space}{Tab}{LShiftKey}(_)
6. 'Send keys' {LMenu}({T}) 'Alt+T
7. 'Send keys' {Return} 'Enter

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Top Solution Authors
Users online (3,887)