<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Dynamic Find and Replace in Macro in General Discussions</title>
    <link>https://community.alteryx.com/t5/General-Discussions/Dynamic-Find-and-Replace-in-Macro/m-p/1359694#M16094</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.alteryx.com/t5/user/viewprofilepage/user-id/18373"&gt;@KieranRidge&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Your expected output&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;&amp;gt; it looks like the workflow you attached doesn't match the screenshot&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;I cannot find the mismatch. Could you point out where are they?&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;RecordID&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;section1&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;section2&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;section3&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;section1x&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;section2x&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;section3x&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;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t;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So if the section names are fed to Batch macro with one column and multiple rows,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;it will output the result of Find Replace for each [section] separately.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;So I do not think batch macro can be a solution in your case.&lt;/P&gt;&lt;P&gt;(Though there may be a solution with batch macro, I cannot figure it out for now)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;User Interface&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;You can make the workflow to Analytic App without Batch Macro as the attached sample.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AppWorkflow.png" style="width: 200px;"&gt;&lt;img src="https://community.alteryx.com/t5/image/serverpage/image-id/393380i5B7B5FCE2362AFC7/image-size/small?v=v2&amp;amp;px=200" role="button" title="AppWorkflow.png" alt="AppWorkflow.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="UserInterface.png" style="width: 200px;"&gt;&lt;img src="https://community.alteryx.com/t5/image/serverpage/image-id/393381i41531BB742648A2C/image-size/small?v=v2&amp;amp;px=200" role="button" title="UserInterface.png" alt="UserInterface.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AppResults.png" style="width: 200px;"&gt;&lt;img src="https://community.alteryx.com/t5/image/serverpage/image-id/393382i8F257970992B1848/image-size/small?v=v2&amp;amp;px=200" role="button" title="AppResults.png" alt="AppResults.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 12 Jan 2025 22:55:50 GMT</pubDate>
    <dc:creator>Yoshiro_Fujimori</dc:creator>
    <dc:date>2025-01-12T22:55:50Z</dc:date>
    <item>
      <title>Dynamic Find and Replace in Macro</title>
      <link>https://community.alteryx.com/t5/General-Discussions/Dynamic-Find-and-Replace-in-Macro/m-p/1359142#M16088</link>
      <description>&lt;P&gt;Hello Alteryx Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It has been a long time since I posted. I'm back at batch macros and am pretty rusty on some of the less intuitive parts so I am turning here. I'm setting up a batch macro where I am running a Find and Replace for multiple different fields. Section1 is in both inputs and pulls in field Section1x, then Section2 is in both inputs and pulls in field Section2x, etc. I plan on doing this for dozens of fields at once. I overwrote the backend XML code pretty well but when I plug in the Text Input to feed the field names to run it on, the outputs get Unioned. E.g. I'll have 5 records in the input, but since I run the Find and Replace for three different fields, it runs the workflow thrice and yields 15 total records in the output. I think the solution might be the Group By option, but that appears not to be deduping the outputs (I'll also take suggestions to any good Group By tutorial refreshers for batch macros because again, I am rusty). Here's a screenshot of what the current output is vs. what I would like the output to be. I feel like this is something of a general question but I just can't figure it out for my particular workflow.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="current output.png" style="width: 400px;"&gt;&lt;img src="https://community.alteryx.com/t5/image/serverpage/image-id/393285i77C7D2AFD12C003E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="current output.png" alt="current output.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="desired output.png" style="width: 400px;"&gt;&lt;img src="https://community.alteryx.com/t5/image/serverpage/image-id/393286iCA7DE0F85C4B8F0D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="desired output.png" alt="desired output.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;Also, subsequently off of that, does anyone know how to change it so I can just select the fields I want to run through the macro as a list on the macro interface? That would replace manually typing out the field names into the Text Input like I currently do. I think this would involve changing the Control Parameter to a List Box, but playing around with it isn't working. I've done it before as you see in a previous macro below, but unsure how to replicate in this scenario. YXZP file attached. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="previous list box questions example.png" style="width: 400px;"&gt;&lt;img src="https://community.alteryx.com/t5/image/serverpage/image-id/393289iBE83E4EE4CC4D958/image-size/medium?v=v2&amp;amp;px=400" role="button" title="previous list box questions example.png" alt="previous list box questions example.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;BR /&gt;KPR&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jan 2025 21:33:36 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/General-Discussions/Dynamic-Find-and-Replace-in-Macro/m-p/1359142#M16088</guid>
      <dc:creator>KieranRidge</dc:creator>
      <dc:date>2025-01-11T21:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Find and Replace in Macro</title>
      <link>https://community.alteryx.com/t5/General-Discussions/Dynamic-Find-and-Replace-in-Macro/m-p/1359291#M16089</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.alteryx.com/t5/user/viewprofilepage/user-id/18373"&gt;@KieranRidge&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would get your desired output with Transpose / Cross Tab as attached (without Batch Macro).&lt;/P&gt;&lt;P&gt;The idea is to create a unique key for each value to replace, so that it can be replaced with one-shot.&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Workflow&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="workflow.png" style="width: 999px;"&gt;&lt;img src="https://community.alteryx.com/t5/image/serverpage/image-id/393318i1CC9B63FEF837259/image-size/large?v=v2&amp;amp;px=999" role="button" title="workflow.png" alt="workflow.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Formula #1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" color="#0000FF"&gt;[Name] = Replace([Name], "section", "")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Formula #2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" color="#0000FF"&gt;[section] =&amp;nbsp;REGEX_Replace([Name], "\l", "")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" color="#0000FF"&gt;[FindReplace] =&amp;nbsp;IF EndsWith([Name], "x")&amp;nbsp;THEN "Replace"&amp;nbsp;ELSE "Find"&amp;nbsp;ENDIF&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Formula #3&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" color="#0000FF"&gt;[Name2] =&amp;nbsp;IF [Name] = "Value"&amp;nbsp;THEN "section" + [section]&amp;nbsp;ELSE "section" + [section] + "x"&amp;nbsp;ENDIF&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Jan 2025 06:10:38 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/General-Discussions/Dynamic-Find-and-Replace-in-Macro/m-p/1359291#M16089</guid>
      <dc:creator>Yoshiro_Fujimori</dc:creator>
      <dc:date>2025-01-12T06:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Find and Replace in Macro</title>
      <link>https://community.alteryx.com/t5/General-Discussions/Dynamic-Find-and-Replace-in-Macro/m-p/1359424#M16093</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.alteryx.com/t5/user/viewprofilepage/user-id/138387"&gt;@Yoshiro_Fujimori&lt;/a&gt;&amp;nbsp;- thanks, but I'm looking to do this in batch macro form as I am having some analysts take the workflow over from me who aren't as advanced, thus the intended batch macro would set it in such a way that they would only have to select the desired fields to run the Find and Replace up front. So essentially it's a process less advanced users are taking over, thus the front end wouldn't be built to be complex. Also, it looks like the workflow you attached doesn't match the screenshot.&lt;/P&gt;</description>
      <pubDate>Sun, 12 Jan 2025 15:58:58 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/General-Discussions/Dynamic-Find-and-Replace-in-Macro/m-p/1359424#M16093</guid>
      <dc:creator>KieranRidge</dc:creator>
      <dc:date>2025-01-12T15:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Find and Replace in Macro</title>
      <link>https://community.alteryx.com/t5/General-Discussions/Dynamic-Find-and-Replace-in-Macro/m-p/1359694#M16094</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.alteryx.com/t5/user/viewprofilepage/user-id/18373"&gt;@KieranRidge&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Your expected output&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;&amp;gt; it looks like the workflow you attached doesn't match the screenshot&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;I cannot find the mismatch. Could you point out where are they?&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;RecordID&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;section1&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;section2&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;section3&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRON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;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Nature of Batch Macro&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Batch macro processes the data fed to Control Parameter tool&lt;SPAN&gt;&amp;nbsp;row by row.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So if the section names are fed to Batch macro with one column and multiple rows,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;it will output the result of Find Replace for each [section] separately.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;So I do not think batch macro can be a solution in your case.&lt;/P&gt;&lt;P&gt;(Though there may be a solution with batch macro, I cannot figure it out for now)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;User Interface&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;You can make the workflow to Analytic App without Batch Macro as the attached sample.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AppWorkflow.png" style="width: 200px;"&gt;&lt;img src="https://community.alteryx.com/t5/image/serverpage/image-id/393380i5B7B5FCE2362AFC7/image-size/small?v=v2&amp;amp;px=200" role="button" title="AppWorkflow.png" alt="AppWorkflow.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="UserInterface.png" style="width: 200px;"&gt;&lt;img src="https://community.alteryx.com/t5/image/serverpage/image-id/393381i41531BB742648A2C/image-size/small?v=v2&amp;amp;px=200" role="button" title="UserInterface.png" alt="UserInterface.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AppResults.png" style="width: 200px;"&gt;&lt;img src="https://community.alteryx.com/t5/image/serverpage/image-id/393382i8F257970992B1848/image-size/small?v=v2&amp;amp;px=200" role="button" title="AppResults.png" alt="AppResults.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Jan 2025 22:55:50 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/General-Discussions/Dynamic-Find-and-Replace-in-Macro/m-p/1359694#M16094</guid>
      <dc:creator>Yoshiro_Fujimori</dc:creator>
      <dc:date>2025-01-12T22:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Find and Replace in Macro</title>
      <link>https://community.alteryx.com/t5/General-Discussions/Dynamic-Find-and-Replace-in-Macro/m-p/1361758#M16134</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Creating a dynamic find-and-replace macro involves automating the process of identifying text patterns or specific strings in a document or data source and replacing them with the desired values. This can be implemented in various programming environments, such as VBA (Visual Basic for Applications), Python, or other scripting tools.&lt;/P&gt;&lt;P&gt;Example: VBA Macro for Dynamic Find and Replace in Excel&lt;/P&gt;&lt;P&gt;Here's a VBA macro that dynamically performs a find-and-replace operation in an Excel sheet:&lt;/P&gt;&lt;P&gt;Steps to Use:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Open the Excel workbook.&lt;/LI&gt;&lt;LI&gt;Press Alt + F11 to open the VBA editor.&lt;/LI&gt;&lt;LI&gt;Insert a new module (Insert &amp;gt; Module) and paste the following code.&lt;/LI&gt;&lt;LI&gt;Customize the FindReplaceDict dictionary with your dynamic key-value pairs.&lt;/LI&gt;&lt;LI&gt;Run the macro (Alt + F8).&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;vba&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;Copy&lt;/SPAN&gt;&lt;SPAN class=""&gt;Edit&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;Sub DynamicFindAndReplace() Dim ws As Worksheet Dim FindReplaceDict As Object Dim key As Variant Dim cell As Range ' Create a dictionary for dynamic find-and-replace Set FindReplaceDict = CreateObject("Scripting.Dictionary") ' Add key-value pairs (find text as key, replace text as value) FindReplaceDict.Add "OldValue1", "NewValue1" FindReplaceDict.Add "OldValue2", "NewValue2" FindReplaceDict.Add "OldValue3", "NewValue3" ' Loop through all worksheets For Each ws In ThisWorkbook.Sheets ' Loop through each key in the dictionary For Each key In FindReplaceDict.Keys ' Replace text in the entire worksheet ws.Cells.Replace What:=key, Replacement:=FindReplaceDict(key), _ LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False Next key Next ws MsgBox "Dynamic find-and-replace completed!", vbInformation End Sub&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;Key Features:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Dynamic Dictionary&lt;/STRONG&gt;: Add as many find-replace pairs as needed.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Sheet-wise Operation&lt;/STRONG&gt;: It processes all worksheets in the workbook.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Flexible Matching&lt;/STRONG&gt;: Uses partial or case-insensitive matching.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Example: Python for Dynamic Find and Replace&lt;/P&gt;&lt;P&gt;If you're working outside Excel, Python with pandas or regular expressions can be used for dynamic find-and-replace.&lt;/P&gt;&lt;P&gt;Let me know if you'd like the Python version or need customization!&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2025 08:38:21 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/General-Discussions/Dynamic-Find-and-Replace-in-Macro/m-p/1361758#M16134</guid>
      <dc:creator>sonalsharmaqueen</dc:creator>
      <dc:date>2025-01-17T08:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Find and Replace in Macro</title>
      <link>https://community.alteryx.com/t5/General-Discussions/Dynamic-Find-and-Replace-in-Macro/m-p/1364224#M16175</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.alteryx.com/t5/user/viewprofilepage/user-id/672146"&gt;@sonalsharmaqueen&lt;/a&gt;&amp;nbsp;- thanks but I am trying to do this in Alteryx, not Excel.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jan 2025 22:27:18 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/General-Discussions/Dynamic-Find-and-Replace-in-Macro/m-p/1364224#M16175</guid>
      <dc:creator>KieranRidge</dc:creator>
      <dc:date>2025-01-26T22:27:18Z</dc:date>
    </item>
  </channel>
</rss>

