EXCEL – Reminder

02/10/2015 § Leave a comment

Application.ScreenUpdating = False
Application.ScreenUpdating = True

..::..

Worksheets(“Menu”).Select
Sheets(“Menu”).Activate
Range(“A1”).Select

..::..

Hide Rows
Rows(“15:20”).Select
Selection.EntireRow.Hidden = True

..::..

Protect / Unprotect Sheet

Sheets(“Menu”).Protect Password: = “22”
Sheets(“Menu”).Unprotect Password: = “22”

..::..

Deselect Range After Macro

Application.CutCopyMode = False

..::..

Formula =SHEETNAME()

Function SheetName()
SheetName = ActiveSheet.Name
End Function

..::..

 

Advertisements

EXCEL – Autosave Workbook

02/10/2015 § Leave a comment


In your workbook code:

Private Sub Workbook_Open()
    If Second(Now) < 30 Then
        Application.OnTime VBA.TimeSerial(Hour(Now), Minute(Now), 30), "macro_save"
    Else
        Application.OnTime VBA.TimeSerial(Hour(Now), Minute(Now) + 1, 0), "macro_save"
    End If
End Sub

In a standard module:

Public Sub macro_save()
    ThisWorkbook.Save
    If Second(Now) < 30 Then
        Application.OnTime VBA.TimeSerial(Hour(Now), Minute(Now), 30), "macro_save"
    Else
        Application.OnTime VBA.TimeSerial(Hour(Now), Minute(Now) + 1, 0), "macro_save"
    End If
End Sub

 

 

Source:
http://stackoverflow.com/questions/15149041/save-excel-file-every-30-seconds-using-system-time

 

Where Am I?

You are currently viewing the archives for October, 2015 at RheXenoR.