SOLVED

excel

%3CLINGO-SUB%20id%3D%22lingo-sub-2526614%22%20slang%3D%22en-US%22%3Eexcel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2526614%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EHi%20I%20need%20Sheet%20Backup%20and%20Restore%20in%20Excel%20VBA%26nbsp%3BPlease%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2526614%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2526713%22%20slang%3D%22en-US%22%3ERe%3A%20excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2526713%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1098287%22%20target%3D%22_blank%22%3E%40RohullahSharifi1020%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22VIiyi%22%3E%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3EIt's%20simple%20code%20and%20more%20efficient%20than%20that%2C%20what%20more%20could%20you%20need!%20%3A))%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22VIiyi%22%3E%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3EVBA%20code%20should%20be%20placed%20in%20%22This%20Workbook%22.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3EOption%20Explicit%0A%0APrivate%20Sub%20Workbook_Open()%0ABackup%20_%0A%20%20%20%20%20%20%20%20intHrs%3A%3D6%2C%20_%20%20'insert%20the%20time%20(in%20hours)%20after%20how%20many%20hours%20it%20should%20backup%20each%20time%20%20%0A%20%20%20%20%20%20%20%20strPathIn%3A%3D%22%5C%5CNAS3%5CTeam%5COwn%5CFilename_Backup_2022%5C%22%20%20%20'insert%20the%20path%20where%20the%20backup%20should%20be%20saved.%0AEnd%20Sub%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20would%20be%20happy%20to%20know%20if%20I%20could%20help.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENikolino%3C%2FP%3E%3CP%3EI%20know%20I%20don't%20know%20anything%20(Socrates)%3C%2FP%3E%3CP%3E*%20Kindly%20Mark%20and%20Vote%20this%20reply%20if%20it%20helps%20please%2C%20as%20it%20will%20be%20beneficial%20to%20more%20Community%20members%20reading%20here.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2526741%22%20slang%3D%22en-US%22%3ERe%3A%20excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2526741%22%20slang%3D%22en-US%22%3EThanks%20Nikolino%20for%20your%20information%2C%20I%20want%20to%20have%20everything%20at%20my%20disposal%20so%20that%20I%20can%20backup%20and%20restore%20myself.%3CBR%20%2F%3EThanks%20again%3C%2FLINGO-BODY%3E
New Contributor

Hi I need Sheet Backup and Restore in Excel VBA Please

2 Replies
best response confirmed by RohullahSharifi1020 (New Contributor)
Solution

@RohullahSharifi1020 

 

It's simple code and more efficient than that, what more could you need! :))

VBA code should be placed in "This Workbook".

 

 

Option Explicit

Private Sub Workbook_Open()
Backup _
        intHrs:=6, _  'insert the time (in hours) after how many hours it should backup each time  
        strPathIn:="\\NAS3\Team\Own\Filename_Backup_2022\"   'insert the path where the backup should be saved.
End Sub

 

 

I would be happy to know if I could help.

 

Nikolino

I know I don't know anything (Socrates)

* Kindly Mark and Vote this reply if it helps please, as it will be beneficial to more Community members reading here.

Thanks Nikolino for your information, I want to have everything at my disposal so that I can backup and restore myself.
Thanks again