jeudi 12 décembre 2019

VBA to populate word heading if excel range not blank

Hi I am thinking of writing code to populate a word document with standard text from an existing word document if an excel range is populated using a macro button in excel (to be user friendly). I have some excel vba experience but not in word. The scenario is we have a construction bill of quantities in excel with different worksheets that are linked to headings in the word specification. So for example if cells in column 4 of worksheet called "B" are populated use standard text in new word doc under heading "Section 1.8" if range is blank just say "Not required" under Section 1.8. I guess I need a for each loop on the sheets that then opens and copies the standard text to the relevant section if range not blank. I dont know how to do this as all excel to word examples I've seen online and in my excel vba textbook are on blank documents. This could be using ctrl f in word to the heading or other method. Any ideas?

Aucun commentaire:

Enregistrer un commentaire