• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Need help with loop entry

Yep, can change it to whatever you want. Would change that line to something like:
Code:
fName = "C:\Some Folder\That I made up\Extract_" & Format(Now, "dd-mmm-yy h-hh-ss") & ".xlsx"
 
Hi Luke,

I have ammended the file path, one finial thing remains and not sure if this can be incorporated, is it possible to add the user name to the file name before it is saved. for eg the randomizer will be used by multiple analyst, current the files are being saved as Extract_current date and time, will it possible to automatically add the analyst name to the code insted of Extract using the enironment variable
 
Yep. Perhaps something like one of these?
Code:
'If you want the User Name from XL
fName = "C:\Some Folder\That I made up\" & Application.UserName & "_" & Format(Now, "dd-mmm-yy h-hh-ss") & ".xlsx"

'WIndows user name:
fName = "C:\Some Folder\That I made up\" & environ("username") & "_" & Format(Now, "dd-mmm-yy h-hh-ss") & ".xlsx"
 
Back
Top