+ Reply to Thread
Results 1 to 3 of 3

Macro help for a different user.

  1. #1
    Forum Contributor
    Join Date
    01-17-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    402

    Post Macro help for a different user.

    I have the following macro which I am using on my desktop.
    If I shared the same file so that others can also use, it is not working because of the username. My user name is "user1" and there are 70 users which want to run the same file in same manner. So any suggestions so that to capture the username automatically or any help????

    The belo macro is working fine for me
    PHP Code: 
    Option Explicit
    Sub Copy
    ()
    Dim fpath As String
    Sheets
    ("Raw Data").Range("A2:AE13000").ClearContents

    fpath 
    "D:\Documents and Settings\user1\Desktop\"
    Workbooks.Open (fpath & "
    usc.xls")

    Workbooks("
    usc.xls").Sheets("Survey Details").Range("B5:BF12000").Copy Workbooks("CSAT US&C Falcons.xlsm").Sheets("Raw Data").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
    Workbooks("
    usc.xls").Close
    End Sub 
    Last edited by kishoremcp; 04-30-2012 at 12:21 AM.

  2. #2
    Valued Forum Contributor StevenM's Avatar
    Join Date
    03-23-2008
    Location
    New Lenox, IL USA
    MS-Off Ver
    2007
    Posts
    910

    Re: Macro help for a different user.

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Macro help for a different user.

    hi

    if every user's username has been input to windows, this code should work for your file path

    Please Login or Register  to view this content.
    if not, you will have to get the user to input their own username, something like this:

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1