logo elektroda
logo elektroda
X
logo elektroda

Creating Word Macro to Update Prices from Excel Based on Product Symbol

kurak071 7197 7
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 17100543
    kurak071
    Level 2  
    Hello to all forum users.
    I searched but did not find, maybe I was looking wrong or it wasn't.
    I have a problem.
    I created a product catalog in Word, these are tables with the product symbol and the price. The tables are already formatted.
    Is it possible to create a macro for Word to search in Excel for the appropriate Symbol from the table and update its price?
    I think the picture will explain everything. I have around 300 such tables in the word.
    Creating Word Macro to Update Prices from Excel Based on Product Symbol

    If it is very complicated I can pay some reasonable money for the solution because I am desperate.
  • ADVERTISEMENT
  • #2 17100574
    marcinj12
    Level 40  
    I think it will help if you upload a sample page or two of this Word. Do you have all the tables in one file? Is this a one-time or cyclical solution? Do the tables necessarily have to be in Word, for example, you can not restore them in Excel and from there save to PDF or copy to Word? And what kind of Officer do you work on?
  • ADVERTISEMENT
  • ADVERTISEMENT
  • #4 17100648
    marcinj12
    Level 40  
    Good morning, I see a certain inconsistency here: in Word you have "short" symbols, in Excel - long names or 4 digital codes. Will you later transform it into a form consistent with Word? Are you sure these codes will be unique among these 300 tables?
  • #5 17100656
    kurak071
    Level 2  
    The codes will be unique, Wapro exports prices by catalog codes and the export of articles is by commercial and catalog codes but without prices.
    So I'll do it by horizontal search and write it in a separate sheet and it should be ok
  • ADVERTISEMENT
  • #6 17100705
    JacekCz
    Level 42  
    kurak071 wrote:
    ...
    If it is very complicated I can pay some reasonable money for the solution because I am desperate.


    kurak071 wrote:

    I prefer to do it in a word because it's easier for me to get over it.


    The impression that by optically formatting data we control it better is one of the false promises given by Word class environments. Processing already formatted information is one of the worse ideas.

    Making the topic "God-like" is not shockingly difficult. I would come out of two CLEARLY SEPARATED 'objects', data (understood in a sense close to 'database'), and 'recipe for formatting' (template, template). Seemingly, such a template gives less control over the issue, but this is only apparently. In fact, manual formatting is a dead end.

    advised you to talk locally to someone from webmastering. I would bite it in Java or C #, but you will probably find the most staff for PHP. Produced html in at least 10 ways can be converted to output as PDF.
  • Helpful post
    #7 17100832
    marcinj12
    Level 40  
    I picked something like this: no france-elegance, but on the attached example of Word works. I did the test for ~ 500 tables, the farther the position is, the longer the musule - swapping a single position can take up to several seconds - but it works and it may be useful for something.

    I also have a newer Offic, so probably in VBA-> References you will have to link the older Word library.

    The assumptions are that each the table must start with the word Symbol, and the first column encountered on the right, which is corrected, is begins from the word Price.
    So it must be:
    Quote:
    | Symbol ... something ... | ... something ... | ... something ... | Price ... | Symbol ... something ... | ... something ... | ... something ... | Price ...
    the number of columns between Symbol and Price ... does not matter.

    Because you divide one table in half, the program recognizes up to 5 such divisions in one table, at least in theory, because I have not tested for another case.

    In addition, to check the correctness, writes the price from the cell to the column before substitution. After change, it colors the cell in col. B green, and if it does not find the symbol in all Word - in red.

    Before running the program you need to put the test.docx file in the directory with .xlsm, close it, and at the end of Word you need to save.
  • #8 17101889
    kurak071
    Level 2  
    Hello
    Marcinj12 - You are GOD !!
    Thank you so much for your time. The most important thing is that it works.
    cool
    Thanks again.
    Pozdraiwam

Topic summary

A user seeks assistance in creating a Word macro to update product prices in a Word document based on corresponding symbols found in an Excel file. The user has approximately 300 tables formatted in Word, with unique product codes exported from Wapromag. Responses suggest uploading sample files for clarity and highlight the challenges of processing formatted data in Word. A solution was proposed involving VBA programming, which would allow the macro to identify tables starting with "Symbol" and update the "Price" column accordingly. The user expressed gratitude for the successful implementation of the solution.
Summary generated by the language model.
ADVERTISEMENT