Getting the macro to move to the next cell is easy. As for the rest ... opening a Word file and passing the information into Word ... well that's a whole other story and I would not be able to help with that. Here is some code that will run through a series of cells progressively and pick up the cell value to be used ...
Set appWD = CreateObject("Word.Application")
appWD.Visible = True
'Assuming your list of store names is in column A starting in A1 this will find the last row where there is data
LastRow = Range("A" & Rows.Count).End(xlUp).Row
Path = "C:users\Moree\Documents\" ' This sets the path for opening your Word documents
' this will cycle through the cells from A1 to the LastRow that was defined
For i = 1 To LastRow
FileToOpen = Path & Cells(i, 1) & ".docx" 'defines the Word file to be opened using the contents of the current cell
TextToPaste = Cells(i, 1) '
appWD.Documents.Open Filename:=FileToOpen ' opens the Word file
' this is where you would paste the data into Word
Next 'this will trigger the macro to go to the next cell and start the routing using its information
Accepted Answer ·
Posted 3 years ago