Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. Option Explicit
  2.  
  3. Private Sub Worksheet_Change(ByVal Target As Range)
  4.  
  5. Dim Path As String
  6.  
  7. If Not Intersect(Target, Range("A2")) Is Nothing And Target.Count = 1 Then 'Change the range to fit your needs
  8.  
  9. Application.ScreenUpdating = False
  10. Application.DisplayAlerts = False
  11.  
  12. Path = Target.Value
  13.  
  14. ThisWorkbook.SaveAs Filename:="D:R" & Path
  15.  
  16. Application.ScreenUpdating = True
  17. Application.DisplayAlerts = True
  18.  
  19. MsgBox "Completed"
  20.  
  21. End If
  22.  
  23. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement