Here are some interesting Operating system and softwares tips and tricks 4u.JUST CLICK ON THE PICTURE IN THE BLOG FOR ENALARGED VIEW.


Saturday, February 25, 2012

Record the last modified date internally(Excel 2003, 2007, 2010)

             You want to keep a track of when your Excel sheet was last modified. You want Excel to insert and update the date automatically.
             As a solution for this, you need a VBA code in the working folder so that a macro automatically ensures an update. Open the relevant working folder for this and select the command"Tools → Macro →Macros”. From Excel 2007 onwards, activate the “View” tab in the taskbar and click the “Macros” icon. Now enter a macro name and click “Create” or if a macro already exists, click “Edit”. In the VBA editor, navigate to the “This working folder” entry in the upper left of the project explorer under “VBAProject" of the current file. Double click and open the relevant code window that is now ready for your entries.In the right combination field, select the “SheetChange” system procedure whereupon the relevant number of macros is added below. Add all the further rows as follows:
Private Sub Workbook _ SheetChange(ByValSh As Object, ByVal Target As Range) Application.EnableEvents = False Sh.Range("A1").Value = Date Sh.Range("A1").NumberFormat = "mm/dd/yyyy" Applications.EnableEvents = True End Sub
               The sample code is triggered on the current sheet by the result of the change. The value of the current date is then entered on the sheet in the “A1” cell. It is mandatory to switch the event processing off within the macros in this example; else, the change in the A1 cell automatically triggers the next SheetChange event. This would always lead to an endless recursions. Instead of a separate entry for every table, you can also access the document property and update it centrally in the same table. Then also specify the relevant work sheet, for instance:
Worksheet("Sheet1").Range("A1"). Value= ThisWorkbook. BuiltDocumentProperties(12)
               This command will change the A1 cell in Table1 and assigns it with the document property specified with the last change. This is the information that can be called up in the file properties under Windows. After entering the script, close the VBA editor and save the Excel file in your document folder. When calling up the sheet, ensure that the contained macros are activated; else, the security settings prevent the functioning of the macro.


Post a Comment

please write your comment

Note: Only a member of this blog may post a comment.

THE WINDOWS TRICKS Headline Animator