PDA

View Full Version : How to copy files into a current user profile folder using Excel VBA macro?



borman2005
04-14-2008, 09:15 AM
Can someone help me with VBA subset for an Excel macro to copy files into a folder within a "current user" folder? Basically, when current user "JDoe" would click on a macro button, it would copy files into a specified folder within his\her userprofile.

Thanks in advance!

tstav
04-14-2008, 11:03 AM
I assume that by 'current user' you mean the user's logon username.
If the specified folder is strFolder, then try
"C:\Documents and Settings\" & Environ.("UserName") & "\" & strFolder