This doesn't sound like a good idea to me. I'd create a dedicated macro to do
the save and only run it when I needed to--not for each change to A1.
But if you want...
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
dim myFolderName as string
dim myFileName as string
if target.cells.count > 1 then
exit sub 'one cell at a time!
end if
if intersect(target, me.range("a1:B1")) is nothing then
exit sub
end if
myfilename = me.range("a1").value
if myfilename = "" then
exit sub 'no file entered
end if
myfoldername = me.range("b1").value
if myfoldername = "" then
exit sub 'no folder entered
end if
if right(myfoldername,1) <> "\" then
myfoldername = myfoldername & "\"
end if
application.displayalerts = false 'no overwrite this file pompt
on error resume next
thisworkbook.saveas filename:=myfoldername & myfilename, _
fileformat:=xlworkbooknormal
if err.number <> 0 then
err.clear
msgbox "Error while saving"
else
msgbox "saved ok" 'comment out when done testing!
end if
on error goto 0
application.displayalerts = true
End sub
I really wouldn't use this.