How to place excel VBA code on save event

前端 未结 1 1544
北恋
北恋 2021-01-29 08:23

I want to run below VBA code when I save the excel document. I can able to run this code at once but (Not on save) it\'s not working anymore. Could you please help me how can I

相关标签:
1条回答
  • 2021-01-29 08:56

    Not sure if I understood your question correctly, but the BeforeSave Event fires just before saving the file.

    So you would need to put the following in ThisWorkbook module:

    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As   Boolean)
    
    CopyToOtherCell
    
    End sub
    
    0 讨论(0)
提交回复
热议问题