Solved

Copying shhets with formula in Excel

Posted on 2015-01-22
6
91 Views
Last Modified: 2015-04-19
Say, I've a sheet with formula in Excel which occasionally gets deleted. How can I copy the sheet back from a back up copy and ensure that the formula pertain to the new Excel spread sheet? There is the option of copy sheet, from 1 spread sheet to another, but will this bring the formula in and have them pertain to the new spread sheet? I am looking for an efficient way of carrying out this operation.
Thanks
Shaun
0
Comment
Question by:shaunwingin
  • 2
  • 2
6 Comments
 
LVL 49

Expert Comment

by:Rgonzo1971
ID: 40563780
HI,

If you protect the workbook structure, users cannot insert, delete, rename, move, copy, hide or unhide worksheets anymore.

On the Review tab, click Protect Workbook, make sure Structure is ticked and OK

Regards
0
 

Author Comment

by:shaunwingin
ID: 40563805
Its not about protection - this sheet  is a rough working sheet that gets deleted before  xls is sent to client - but don't save xls, Sometimes we save the xls and then need to restore sheet....
0
 
LVL 49

Expert Comment

by:Rgonzo1971
ID: 40563836
with this code in the ThisWorkbook module you could force a SaveAs

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

    Dim strFileName As String

    Cancel = True 'Cancel the save operation

    strFileName = Application.GetSaveAsFilename(Replace(ThisWorkbook.Name, ".xls", "_ClientVersion.xls"))

    If strFileName <> Me.FullName And strFileName <> "False" Then
        Application.EnableEvents = False
            ThisWorkbook.SaveAs strFileName 
        Application.EnableEvents = True
    End If

End Sub

Open in new window

0
 

Author Comment

by:shaunwingin
ID: 40563870
Pls don't  confuse the solution: I'm after this:
"Say, I've a sheet with formula in Excel which occasionally gets deleted. How can I copy the sheet back from a back up copy and ensure that the formula pertain to the new Excel spread sheet? There is the option of copy sheet, from 1 spread sheet to another, but will this bring the formula in and have them pertain to the new spread sheet? I am looking for an efficient way of carrying out this operation.
Thanks
Shaun
0
 
LVL 3

Accepted Solution

by:
Onisan earned 500 total points
ID: 40720580
I would think that the easiest solution is to have a sheet in your Excel workbook that holds an exact copy of your sheet with formulas and have it Hidden, then you can create a copy of it either by unhiding and copying or by doing so in code. either way it will be a very simple process which means you always have a reliable backup.
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How can i compile this github project?? 2 84
Not needed 13 112
Rubik's Cube Code for Effective Presentation 3 54
Advice on Xojo as a development tool over VB. 4 55
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question