PDA

View Full Version : [SOLVED:] Creating Word docs from Excel list



branston
03-27-2020, 06:51 AM
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

snb
03-27-2020, 07:12 AM
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

branston
03-27-2020, 07:42 AM
Thanks snb.