Change Part Of Before Save Code In Bulk?

  • I have loads of files that have a before save code within them. I need to change the location, is it possible to change part of the code without opening them all individually? This is the code


    Code
    1. Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    2. If MsgBox("Save?", vbYesNo, "Confirm") = vbNo Then Exit Sub Application.DisplayAlerts = False
    3. ActiveSheet.Copy ActiveWorkbook.SaveAs Filename:="C:\Documents and Settings\[COLOR=#FF0000]MANAGER[/COLOR]\Desktop\Darrens Catalogues\Suspension_Catalog2.1A.csv", FileFormat:=xlCSV, CreateBackup:=False
    4. ActiveWorkbook.Close False
    5. End Sub



    All I need to change is the 'Manager' in red to Manager1! From another code I have it uses ADO connection and SQL that doesn't open the files is it possible here?

    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


    Always try any codes provided on a copy of your workbook. Once a macro is run it cannot be undone!


    To get the most precise answer, it is best to upload/attach a sample workbook (sensitive data scrubbed/removed/changed) that contains an example of your raw data on one worksheet, and on another worksheet your desired results.


    The structure and data types of the sample workbook must exactly duplicate the real workbook. Include a clear and explicit explanation of your requirements.

  • Cross-posting Without Telling Us


    Your post does not comply with our Forum RULES. Do not cross-post your question on multiple forums without telling us about your threads on other forums.


    Post a link to any other forums where you have asked the same question.


    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.


    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!


    Read https://www.excelguru.ca/content.php?184 to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).


    No further help to be offered, please, until the OP has complied with this request.

  • ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


    Always try any codes provided on a copy of your workbook. Once a macro is run it cannot be undone!


    To get the most precise answer, it is best to upload/attach a sample workbook (sensitive data scrubbed/removed/changed) that contains an example of your raw data on one worksheet, and on another worksheet your desired results.


    The structure and data types of the sample workbook must exactly duplicate the real workbook. Include a clear and explicit explanation of your requirements.