title: Editing an automated naming macro in excel (based on PC name and date, with variable save path)
body: <p>I'm currently trying to get an excel file to save into YYYYMMDD_fixed name piece_INITIALS OF LAST PERSON TO EDIT.</p>
  
  <p>I'm using Environ function to call the User's and PC's name in a cell that i've found can be used to add to the name.</p>
  
  <p>The issues i'm trying to fix are:</p>
  
  <ol>
  <li><p>how can i define the save path to work on any PC regardless of user name, as current path has Users/my name/ , and up to 4 people with different PCs and names will edit this file. it should just save on Desktop on any of the 4 PCs</p></li>
  <li><p>how can i modify the </p></li>
  </ol>
  
  <pre><code>strFile = "C:\Users\me\Desktop\" &amp; Format(dtDate, "ddmmyyyy") &amp; ".xlsx"
  
  </code></pre>
  
  <p>part so  that it displays YYYYMMDD_name (i get this part ok) _ABC where ABC value is in cell A1 generated by the below attr function? </p>
  
  <p>the function used is </p>
  
  <pre><code>Function attr(choice) As String
     Select Case (choice)
        Case "computer": attr = Environ("Computername")
        Case "user": attr = Environ("UserName")
     End Select
  End Function
  </code></pre>
  
  <p>and the one i use to save (albeit a different format on a different file) is</p>
  
  <pre><code>Dim dtDate As Date
      dtDate = Date
  
      Dim strFile As String
      strFile = "C:\Users\me\Desktop\" &amp; Format(dtDate, "ddmmyyyy") &amp; ".xlsx"
  
      ActiveWorkbook.SaveAs Filename:=strFile, FileFormat _
      :=51, CreateBackup:=False
  </code></pre>
  
  <p>Any help would be greatly appreciated! 
  Programming is not my main job, just trying to automate bits where possible, so go easy on me please :)</p>