I am trying to create a Macros that will create a word document(for notes) and link it to a cell in the row and same the document using the value in the cell.
My code is able to do just that for one cell but I want it to be able to run through the different cells in the row and save each document created with the value of each cell. my code gives me an erro saying document exist if I try to run it on other cells. PLEASE help.
Sub Macro1()
'
' Macro1 Macro
'
'
Dim NumRows As String
SaveName = Range("A3", Range("A3")).End(xlDown).Value
Range("A3").Activate
For Each A In Range("A3", Range("A3")).End(xlDown)
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
"\\rqhdata4\Quality Impr\PERSONAL FILES\Chinedu\Note\"
ActiveSheet.Hyperlinks(ActiveSheet.Hyperlinks.Count).CreateNewDocument _
Filename:="\\rqhdata4\Quality Impr\PERSONAL FILES\Chinedu\Note\ " & SaveName & ".docx", _
EditNow:=True, Overwrite:=False
Next A
End Sub
My code is able to do just that for one cell but I want it to be able to run through the different cells in the row and save each document created with the value of each cell. my code gives me an erro saying document exist if I try to run it on other cells. PLEASE help.
Sub Macro1()
'
' Macro1 Macro
'
'
Dim NumRows As String
SaveName = Range("A3", Range("A3")).End(xlDown).Value
Range("A3").Activate
For Each A In Range("A3", Range("A3")).End(xlDown)
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
"\\rqhdata4\Quality Impr\PERSONAL FILES\Chinedu\Note\"
ActiveSheet.Hyperlinks(ActiveSheet.Hyperlinks.Count).CreateNewDocument _
Filename:="\\rqhdata4\Quality Impr\PERSONAL FILES\Chinedu\Note\ " & SaveName & ".docx", _
EditNow:=True, Overwrite:=False
Next A
End Sub