Consulting

Results 1 to 7 of 7

Thread: Copy specific text from Word to Excel using VBA

  1. #1

    Copy specific text from Word to Excel using VBA

    Hello All,

    I am trying to copy fields like Sales Order no. and Date with corresponding value from the word file (attached herewith). I am having multiple word files from where I need to search (different keywords) and copy paste it in my excel.
    Also is there a possibility to copy the text from header?

    Appreciate your help.

    Regards,
    Mayur
    Attachments Pending Approval Attachments Pending Approval

  2. #2
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,125
    Location
    There are multiple threads here showing how to extract data from Word documents and insert those data into Excel. What have you tried?
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3

    Copy specific text from Word to Excel using VBA

    Quote Originally Posted by macropod View Post
    There are multiple threads here showing how to extract data from Word documents and insert those data into Excel. What have you tried?
    Thanks Paul for your response. I did look at "Import Words and Phrases from MS Word to Excel" but my issue is with searching on different text with corresponding values. e.g. here the 'Sales order' changes to "invoice number" in other word file and so on. Also wanted to know if we can fetch data from header.
    With Regards,
    Mayur

  4. #4

  5. #5

    Copy specific text from Word to Excel using VBA

    [QUOTE=macropod;402692]There are threads discussing that here, too. For a very recent example,

    Thank you so much Paul. I used "Need to Pull Specific Data/Text from Word to Specific Cells in Excel" and it works fine!
    Should I create an array as my search text will need to added / modified based on the word docs?

  6. #6
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,125
    Location
    Quote Originally Posted by mvakharia View Post
    Should I create an array as my search text will need to added / modified based on the word docs?
    That's up to you - but you'd probably have to do the same thing for the Replace expressions, too.
    Last edited by macropod; 05-31-2020 at 11:53 PM.
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  7. #7
    Thank you! You are doing a very kind job of helping people. God bless you!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •