Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Copying shhets with formula in Excel

Posted on 2015-01-22
6
Medium Priority
?
95 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
6 Comments
 
LVL 52

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 52

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 2000 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 top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
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 …
Progress

721 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