Sure! I've attached them as follows. And yes, it would be preferable if the Word Document could remain editable.
Basically the macro I'm trying to get the macro to fill in the student number and name on the world document using the appropriate cells in excel. Ideally then it would select all the courses that particular student took and paste that into the word document with the appropriate grades and numbered accordingly as shown in the word document. [This is the complicated part given that every student takes a different number of courses.] The macro would then save as the student number and close. I have somewhat managed the front portion of this with this macro I pieced together which doesn't use bookmarks:
Sub ControlWord()
Dim appWD As Word.Application
Dim Name As String
Set appWD = CreateObject("Word.Application")
appWD.Visible = False
Sheets("Sheet1").Select
FinalRow = Range("A9999").End(xlUp).Row
For i = 2 To FinalRow
Sheets("Sheet1").Select
Range("B" & i).copy Destination:=Sheets("Sheet2").Range("B1:C1")
Range("A" & i).copy Destination:=Sheets("Sheet2").Range("B2:C2")
Range("A4:G37").copy
appWD.Documents.Add
appWD.Selection.Paste
Name = Sheets(1).Cells(i, 1).Value
appWD.ActiveDocument.SaveAs filename:= Name
appWD.ActiveDocument.Close
Next i
appWD.Quit
End Sub
I know it's not a very elegant way of doing this and it does cause problems. Using the macro to paste from excel into word makes the entire table longer than one page. I don't encounter this problem while manually copying and pasting. Terribly long wall of text but thanks for reading through! I'm happy to explore other methods.
Bookmarks