Skip to content

Instantly share code, notes, and snippets.

@ateneva
Created April 22, 2017 10:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ateneva/fd9b26f373ca4fcd2fe264ac8d14d6d9 to your computer and use it in GitHub Desktop.
Save ateneva/fd9b26f373ca4fcd2fe264ac8d14d6d9 to your computer and use it in GitHub Desktop.
Quickly update desktop paths depending on who is using the workbook at the moment
Private Sub Workbook_Open()
Dim Cell As Range
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Application.Calculation = xlCalculationAutomatic
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'update paths
Worksheets("MACROS").Activate
If Application.UserName = "Angelina Teneva" Then
For Each Cell In ActiveSheet.Range("A4:A27")
Cell.Value = Cell.Offset(0, 15)
Next Cell
Else
For Each Cell In ActiveSheet.Range("A4:A27")
Cell.Value = Cell.Offset(0, 17)
Next Cell
End If
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment