' Reference to worksheet - substitute correct sheet number or name Set xlWbk = (FileName:="C:\Excel\Concordance.xlsx") ' Open workbook - substitute correct path and filename MsgBox "Failed to start Excel", vbExclamation Set xlApp = CreateObject(Class:="Excel.Application") Set xlApp = GetObject(Class:="Excel.Application") The word document to be processed should be the active document when you run the macro. I would be grateful if someone could extend this code that instead of "Level" it loads value from A1 in excel and instead of "Height" it loads value from B1 in excel, then do the same with A2 and B2, A3 and B3 and so on. Here is the code for simple find and replace: Moreover I want it to do this on an word file, not the excel file itself. However I want to create a sort of "loop" that goes from A1 to A900 and replaces the findings from B1 to B900 accordingly. I know how to create a macro and record it for one by one find and replace. The "A" column has the original word, the "B" column has the replacement word. I have created an excel file that has two columns. I have a word file that has many words or sentences I want to replace.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
February 2023
Categories |