Consulting

Results 1 to 3 of 3

Thread: Creating Word docs from Excel list

  1. #1

    Creating Word docs from Excel list

    Hi

    I have a long list of filenames(text) in an excel spreadsheet going from B2:B151. I need to create (new) word documents for each of the filenames in cells B2:B151. The filename of the newly generated word doc will just be the text in each cell (from B2:B151).

    Is this possible in VBA? Can anyone help?



    Many thanks in advance

  2. #2
    Knowledge Base Approver VBAX Wizard
    Joined
    Apr 2012
    Posts
    5,635
    Sub M_snb()
       sn=sheet1.range("B2:B151")
    
       with createobject("Word.document")
          .windows(1).visible=true
          for j=1 to ubound(sn)
            .saveas2 sn(j,1)
          next
      end with
    End Sub

  3. #3
    Thanks snb.

Posting Permissions

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