简体   繁体   中英

Need a macro to search and replace data in XML using VBA

I need this help, I tried many ways but not could not figure out.

I have a folder (c:\mydocument) which contains multiple xml files (Lets say 100) and also 1 excel file (name=usermapping" which contains Column A multiple email id (lets say 50) eg. abc@gmail.com and column b also has different email ids abcdef@gmail.com

I need a VBA code, which will open these xml files and search for email -ids in column A of excel file and replace the xml with Column "B" email ID's.

Any help in this regard would be highly appreciable. If you need any questions or clarification, please do reply to this message.

Warm regards

Johnny

I can give you workaround instead of code. Use Power query to get data from XML. Once you have data then create a calculated column, where you can change/replace. Now push that data into the table, and create code to save as.xml.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM