+ Reply to Thread
Results 1 to 4 of 4

Managing Updates to VBA Macro Code for Multiple Users

  1. #1
    Registered User
    Join Date
    09-02-2012
    Location
    Saudi Arabia
    MS-Off Ver
    Excel 2007
    Posts
    15

    Post Managing Updates to VBA Macro Code for Multiple Users

    I have a excel file with macro code :

    Sub UpdatePCS()
    '
    ' UpdatePCS Macro
    '
    ' Keyboard Shortcut: Ctrl+Shift+Z
    '
    'To Update SCA PCS
    Workbooks.Open Filename:="C:\Users\aryalsx\Desktop\SCA PCS.xlsx"
    Range("A8:BH600").Select
    Selection.Copy
    Windows("FULL STOCK.xlsm").Activate
    Sheets("FULL STOCK").Select
    Sheets("SCA PCS").Visible = True
    Sheets("SCA PCS").Select
    Range("A8").Select
    ActiveSheet.Paste
    Range("A8").Select
    Windows("SCA PCS.xlsx").Activate
    ActiveWorkbook.Save
    ActiveWindow.Close
    Sheets("SCA PCS").Select
    ActiveWindow.SelectedSheets.Visible = False
    Sheets("FULL STOCK").Select
    End Sub

    in this code 'aryalsx' is my pc user name and I want to use this excel file in another user (i.e. abcd) too. I can replace user code 'aryalsx' to 'abcd' but I want to keep both users in vba code to use both users without changing code. can anyone help me?

    Thank you in advanced for your effort :-)

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,914

    Re: Managing Updates to VBA Macro Code for Multiple Users

    How about this ?

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Managing Updates to VBA Macro Code for Multiple Users

    Unfortunately your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    09-02-2012
    Location
    Saudi Arabia
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Managing Updates to VBA Macro Code for Multiple Users

    Thank you @bakerman2 it's worked. You are a genius.
    can you tell me how can I Use With ... End With to avoid select?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 01-27-2014, 05:06 PM
  2. Multiple users executing code in .xls file causing error
    By fonzi in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 09-18-2013, 12:01 PM
  3. How to send Updates for an excel workbook to other users
    By jetlee in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-30-2013, 12:43 PM
  4. Managing multiple listboxes with one code
    By bulina2k in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-13-2013, 03:13 PM
  5. Managing sales data from multiple users.
    By JRedfield in forum Excel General
    Replies: 0
    Last Post: 11-22-2011, 01:36 PM
  6. Multiple Users for Code
    By TheMan4392000 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-18-2011, 04:50 PM
  7. Macro for Multiple Users
    By Legallyshe in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-25-2010, 09:29 AM
  8. managing code in vba editor
    By fozze in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-30-2008, 09:55 AM

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