1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Excel find and replace macro

Discussion in 'Business Applications' started by al_the_boss, Jul 16, 2012.

Thread Status:
Not open for further replies.
Advertisement
  1. al_the_boss

    al_the_boss Thread Starter

    Joined:
    Jul 16, 2012
    Messages:
    2
    Hi I am complete noob but need some help ASAP (not sure if this is correct forum)
    Basically I have an xml file, which I need to edit, see below (the * are just editted data, so work dont complain )
    Ok, so that is the XML file, it will have this reoccuring for all the orders within that file.
    Everytime it says
    I want to replace the numbers between <SKU></SKU>, with another SKU from a list...
    E.G. Find
    Replace
    The only reason I am struggling is because <SKU></SKU> occurs beneath
    I dont want to alter this SKU as it is the DELIVERY SKU, I only wish to adjust the ITEM SKU (SKU above<DESCRIPTION><!)
    So find and replace with a RANDOM SKU from a LIST.
    E.G. 1234567, 8910111, 1213141, 5161718, 1920212 etc etc


    I can copy the data stored in an XML file and just past into a single column in Excel.




    Is this possible?
    And if so would anyone mind showing? :)
    THANKS in ADVANCE!
     
  2. Zack Barresse

    Zack Barresse

    Joined:
    Jul 25, 2004
    Messages:
    5,447
    Hi there, welcome to the board!

    Do you have the xml file you can share/upload? I'm not really sure I understand why, but I think I understand how you want to do this. You just want a random number on the Item SKU, is that right? Then what, save it as a different file?
     
  3. al_the_boss

    al_the_boss Thread Starter

    Joined:
    Jul 16, 2012
    Messages:
    2
    Hi zack
    Basically we making some test data...We have these old xml files and only need to change the ITEM SKU's for our new testing. So we edit these lines and then push the editted xml file back through the system...

    Er, I wanna replace the ITEM SKU's with a RANDOM sku from a designated list of about 80 new SKU's.
    E.G. <ORDER_LINE_ID>1</ORDER_LINE_ID>
    <SKU>1234567</SKU>

    Replace <SKU>1234567</SKU> with a RANDOM SKU from the 'New SKU list'

    New SKU list
    <SKU>1111111</SKU>
    <SKU>2222222</SKU>
    <SKU>3333333</SKU>
    <SKU>4444444</SKU>
    <SKU>5555555</SKU>
    <SKU>6666666</SKU>

    I can paste this new list into the same excel file as the pasted XML code if needed.

    Hope this makes sense now, and thanks for your time!
     
  4. Zack Barresse

    Zack Barresse

    Joined:
    Jul 25, 2004
    Messages:
    5,447
    Sorry for not getting back right away, it's been busy. Do you have the file for us to work with?
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1061252