Save Today() As Value To Prevent Changes On Reopen
Jul 30, 2008
I have a spreadsheet that containt a conditional formula to place the current date aka Today() into a cell based on if an entry in the previous cell.
I put in this formula:
=IF(I131>="1",TODAY()," ")
My boss told me to update to this one: (same result)
=IF(I130>="1",DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY()))," ")
BOTH will change the saved sheet data if we open it tomorrow (due to using Today()). We want to retain the date that it was entered on (which will always be the date he puts entry into sheet).
Is there a way to save the sheet and update the code for Today() to the date value so it will appear as a date when it's opened in the future?
View 9 Replies
ADVERTISEMENT
Oct 2, 2007
I am testing the following section of code.
Sub Macro1()
Dim NewWB As Workbook, NewName As String
Set NewWb = Workbooks.Add
NewName = Application.GetSaveAsFilename(ThisWorkbook.Name)
NewWb.SaveAs NewName
NewWb.Close False
Workbooks.Open (ThisWorkbook.Path & "/" & ThisWorkbook.Name)
End Sub
It seems like I need to rename the sheet I am working on in order for this code to work. If I do not, it tells me that it "cannot save this workbook with the same name as another open workbook".
I am trying to use this code to get around an error with Excel described here: [url]
I would like to have the sheet save itself (not "Save As"), close, reopen, and continue running the macro. What adjustments do I need to make to this code to do this. I have tried different things, but I must be getting the syntax wrong.
View 9 Replies
View Related
Oct 17, 2009
I have a wierd issue. I have this macro for a workbook i use and if i run the macro in the first tab it runs and works fine. When i select the other tab and run it it gives me a debug error. If i close the worksheet save it and reopen it and run it in the other tab it runs fine.
So in otherwords i have to run the macro in the tab desired, save it , and always close and reopen the file to run it in the other tabs. I know the code is correct because it runs flawlessly without errors but i must be missing something.
Also i currently have the macro to run on the active tab/worksheet. Can i have it run on multiple tabs? i have 15 20 and 30 tabs in this example file but in my real file i have many more milage intervals ( some tabs i would not want to select ). It gets tedious having to select one tab at a time, run the macro, rinse and repeat.
For Example Run Macro First, in the first tab. It works perfectly. Go to the second tab and run the first macro. It gives a debug error. If you save the file and reopen it and go to teh second tab and run the macro again it works.
View 8 Replies
View Related
Jan 28, 2014
I have a cell using formula
IF(TRUNC(B1)=TRUNC(TODAY()),VLOOKUP(Sheet1!A2,Sheet2!A:D,4,FALSE),"novalue")
Wherein I compare cell B1 containg a date value with current system date and if it is true i lookup a value from another sheet.
My problem is next day when i open the excel the previous days value is getting erased as my if logic is returning false.
Is there any way to freeze my previous days value while opening the excel the next day
day 27 i have this value
drugcode27-01-201428-01-201429-01-2014
AA0011
day 28 when i open the excel it shows'
drugcode27-01-201428-01-201429-01-2014
AA001novalue1
I want to freeze the value under date 27-01-2014
View 7 Replies
View Related
Jul 28, 2007
Is there a way to save a file and have it automatically put today's date in the file name?
Example: original File name = test.xls
desired file name = test072807.xls, or test.072807.xls, or test.07 28 07.xls
So, I open the file, do whatever, and then click save.
When I click save, it does one of the above, given that today is 7 28 07.
View 9 Replies
View Related
Jan 28, 2013
am trying to create a workbook template which collects data from users with user forms and some macros. Users assign a project name when workbook opens and then they are able to save as the workbook with name of project name. But i don't want them to save on my template mistakenly. How do i prevent this? I tried workbook_before close sub but i can manage that it recommends to save workbook with project name and if you don't want, it still asks you if you want to save workbook before close
View 7 Replies
View Related
Nov 28, 2007
I want to make sure that the user of a file only saves from a button on a particular sheet. Can I ensure that if the user goes File Save at any time that they cannot use it?
View 9 Replies
View Related
Feb 21, 2002
Is there any way to write a macro which can prevent computer illiterate users from saving their files EVERYWHERE??
View 9 Replies
View Related
Jan 29, 2009
how to prevent a user saving a Word Document.
View 9 Replies
View Related
Sep 28, 2006
I have a list dropdown from cells A2 to A10. If only when a user selects "orange", he has to key in some description in column B.
Eg if he selects orange in A2, he has to key in some description in B2.
Is it possible to set some formula or macro which prevents user to save this file if he leave blank in B2 or B10, depending on which row he has select "orange"?
View 8 Replies
View Related
Oct 17, 2006
I have an extensive application which I wrote using Excel 2002 (XP - Version 10). However it will likely be used on anything ranging from 2003 - 1997. When I tested it using Excel 97 it gave me the traditional [annoying] message asking if I was sure I wanted to save it under an earlier version than which it was created.
I want to get rid of this message (a lot of my users aren't the most computer literate and the more annoying messages I can avoid the better!)
I tried using:
Application.DisplayAlerts = False
but it doesn't affect this particular message. I need to know how to keep this message from popping up. Please Help.
Under 97 (NOT on my 2002) it also gives a "Do you want to save the changes" message upon closing even though the "DisplayAlerts" is set to false. I'm not sure why this is still coming up.
View 9 Replies
View Related
Jan 19, 2008
In my program I have prevented the user from saving the Workbook with the following code
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim p As String
Cancel = True
Do While Cancel = True
p = InputBox("Enter password to save file:", "Password Required To Save", "")
If p = "Enter Password Here" Then
Cancel = False
Else
yn = MsgBox("Wrong password. Try again?", vbYesNo, "Invalid Password")
If yn = vbNo Then
Exit Sub
End If
End If
Loop
End Sub
I also need to prevent the user, when they use the save as, from saving certain worksheets. Ex: There are 6 worksheets in the workbook. I only want them to be able to save the first three. Issues: One of the workbooks that I want to allow them to change has a tab name that changes frequently.
View 2 Replies
View Related
Jun 24, 2008
I've got a workbook that I want to keep intact in a central location on our local network, to make it easier for everybody to access, but don't want people to be able to save changes to the master workbook itself. I'd like to be able to disable the 'Save' feature while still allowing 'SaveAs'. The following code (installed in ThisWorkbook) results in the OPPOSITE of what I'm trying to accomplish (i.e., it allows 'Save' but disables 'SaveAs'):
Private Sub Workbook_BeforeSave(ByVal SaveUI As Boolean, Cancel As Boolean)
If SaveUI Then
MsgBox "The 'Save' function for this workbook has " & Chr(10) & "been disabled. Please use 'Save As'.", vbOKOnly + vbInformation, "Save Disabled"
Cancel = True
End If
End Sub
Obviously I'd also like to check the filename they're performing the 'SaveAs' under and disallow it if it matches the master filename.
I've thought about making the workbook into a template, which would sort of accomplish the same thing, but it would be much easier to just keep it as a workbook.
View 9 Replies
View Related
Feb 17, 2009
I'd like a macro to have the workbook save as
Numbers as of "today's Date"
and then close that workbook.
I already tried the following...
View 5 Replies
View Related
Mar 21, 2008
I am trying to hide/grey SAVE option from the menu bar and reset menu back to normal after Save AS has been used.
I was able to do disable SAVE using the following code.
Application. CommandBars("worksheet menu bar").Controls("File").Controls(4).Visible = False
But
the SAVE icon on the Standard toolbar still exist. Is there any way I can disable it and also prevent CTRL. S being used.
Second part of the question.
Once I use Save as I would like menu to be reset back to normal.
View 5 Replies
View Related
Mar 20, 2009
When I am saving my spreadsheet as a text file, I have 1 column with formulas that I would like to not show up in my text file. I have tried hiding the column, and have Googled for awhile now.
View 2 Replies
View Related
Jul 25, 2008
action
Work Book . save ***
Action
Workbook. save AS.......
Workbook close
I would like to at this point reopen the orignal workbook as saved in the line marked with ***
I think before the save i need to record the location and filename to a variable "file"
then workbook.open = "File"
View 9 Replies
View Related
Jan 26, 2009
is there a way to get one cell to have a number in it that will change after each time you open it?
View 9 Replies
View Related
Jul 4, 2009
I'm enquiring about this just out of intellectual curiosity.
View 9 Replies
View Related
Mar 17, 2014
I have the following code that needs to execute. Basically, every once in a while, our terminal program encounters an error that makes it so Excel and it can't talk to each other. The only way to fix this is by killing the entire process tree of both terminal and Excel, or restarting the computer. I've written this bit of code in the event it starts happening while someone is using the macro - it checks to see if the two can talk, and if they can't, it just kills both programs.
[Code] .....
Is there any way to launch Excel with a 8 second delay, so that once the kill command executes, Excel re-opens? Or could I write a batch file with delay built in to execute prior to the kill command? I could use Shell to execute that prior to killing Excel, but I'm not sure if that's possible....
View 11 Replies
View Related
Jan 6, 2010
Using excel 2003, I have a ss that uses filters and sorting. I can get to the data I want but must reopen the workbook if I want to start over and extract different information. I tried installing this VBA:
Sub CloseMe()
Application.OnTime Now + TimeValue("00:00:10"), "OpenMe"
ThisWorkbook.Close False
End Sub
Sub OpenMe()
MsgBox "I'm Back!"
End Sub
This is my first time at inserting VBA. Usually I just use keystroke macros. I have set my Excel VB Book options to: Option Explicit double clicked the sheet I was using and under general inserted the code, closed Ctrl+Q, saved workbook. When I reopened and tried to use it all I get is “I'm Back!” nothing else happens. One time it actually ran and reopened but it appeared that the workbook was saved before closing because it was still sorted. What I need is it to completely unsorted as it is when I first open it so I can start over.
View 4 Replies
View Related
Jun 18, 2007
i want vba to show a msgbox every 5 sec & it should start as soon as the file is opened. Below is the code & it works. Problem is, that when i close the file it immediately reopens and starts the "msgbox proess". Only if i close excel completely, this problem goes away (& thats not a very proffessional way to do it!!). Can someone pl look at this one & help ?
Private Sub workbook_open()
Call Macro4
End Sub
Sub Macro4()
Dim i As Integer
MsgBox "test!!"
NextTick = Now + TimeValue("00:00:05")
Application .OnTime NextTick, "Macro4"
End Sub
View 6 Replies
View Related
Dec 2, 2007
I have a spreadsheet that is emailed to someone to fill in. They then fill in some information and send it on to someone else.
Sometimes they don't fill in all the information so is it possible to have excel check that cells are filled in and to prevent someone from saving unless this is so? Or maybe a message stating that the cells need to be completed if Excel is being closed or saved?
View 11 Replies
View Related
Apr 17, 2013
In Excel 2010 I was working on a file setting it up to print. The file closed somehow and I just cannot reopen it. There are other files in the same folder and they all open normally.
View 4 Replies
View Related
Mar 30, 2007
I have a Macro that is stored in a specific workbook,"Projection Modeler.xls" the last line performed in this macro is the close workbooks without saving chages(this needs to be done due to the way this macro was written, and it would take too long to rewrite). If I would then like to reopen this workbook, and then rerun this macro, can I do this from inside the current macro (in a new sub routine, for instance), or do I have to write a macro outside of the workbook and then open the workbook and call the routine?
View 4 Replies
View Related
Mar 11, 2014
am using Excel 2010 and having issues trying to save a worksheet to a specified file location with the save date....
I have tried several posts form this forum and elsewhere and can't seem to get the macro to do what I want.....
I want to save a 'worksheet' from an open workbook that I use for updating information to the same file path as the workbook with the date the file saved...
View 6 Replies
View Related
Dec 3, 2012
I have an expense report, which was originally done in Excel 2003. It still prompts users to open as read only however if they select no, they are not prompted for the password, and it has allowed them to save, so when the next person opens it, they have the previous person's report instead of the clean workbook. I have tried everything to put a password onto it. I know this is really basic stuff, but maybe I am missing a step? I want the end user to be able to make all the changes they want in read only mode and then do a save as, but if the select No when prompted "Open as Read-only?" they should have to put a password in.
View 4 Replies
View Related
Aug 21, 2012
What I am trying to do is that I have an excel file with macros and it is a read-only file. In order for the user to save, I want them to only be able to save as a .xlsx file as it disables all macros. If for whatever reason, the user wants to save the file as another .xlsm file, they should be allowed but before they save, a "are you sure you want to save as .xlsm?" message should pop up.
All the options in the save as box should still be available in case they want to save in that particular format. Just that the .xlsx should be the default.
View 2 Replies
View Related
Sep 6, 2012
I'm trying to make a macro check if a file has been saved (ever). If so I want the macro to do a regular save (with already esatablished filename and location) before it proceeds with the rest of the macro. If the file hasnt been saved (if it runs from a new workbook) then I want it to pop up the save.as dialog, so that the user can choose the name and location of the file before the macro continues .
The macro itself is saved in personal.xlsx.
View 1 Replies
View Related
May 10, 2008
I would like to add some icons on the left side of excel open file pane to faciliate my work. Because i need to load some files under the same folder many times a day. Does anybody know how to do that? I've seen people has more icons on the pane before. The defaut setting has only 'History', 'My Documents', 'Favorites', 'Desktop' and ' My nutwork places' on it.
View 2 Replies
View Related