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

undefined

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

4 REPLIES 4
MichaelAnnis
Memorable Member
Memorable Member

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 I
Helper I

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,189)