By using these VBA macros, you can quickly add greater functionality to your Enterpad. Those extra buttons that haven't been assigned a task yet are just waiting to be used to save you even more time.
Come back for updates! The Enterpad already builds more efficiency into your workflow, but the door is always open to the potential for even more imaginative ideas.
Excel
-
Create a backup of the current workbook.
Sub EP_1() ThisWorkbook.SaveCopyAs Filename:=ThisWorkbook.Path & _ "\" & Format(Date, "mm-dd-yy") & " " & ThisWorkbook.Name End Sub
-
Protect the active sheet
Sub EP_1() ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True End Sub
-
Unprotect the active sheet
Sub EP_1() ActiveSheet.Unprotect End Sub
-
Delete selected sheet(s) with confirmation
Sub EP_1() ActiveWindow.SelectedSheets.Delete End Sub
-
Delete selected sheet(s) without confirmation
Sub EP_1() Application.DisplayAlerts = False ActiveWindow.SelectedSheets.Delete Application.DisplayAlerts = True End Sub
-
Change (for green) the background color of selected cell(s)
Sub EP_1() With Selection.Interior .Pattern = xlSolid .PatternColorIndex = xlAutomatic .Color = 5296274 .TintAndShade = 0 .PatternTintAndShade = 0 End With End Sub
-
Highlight the row of the selected cell
Sub EP_1() With Rows(Selection.Row).Interior .ColorIndex = 6 .Pattern = xlSolid End With End Sub
-
Remove the highlight of the row of the selected cell
Sub EP_1() Rows(Selection.Row).Interior.ColorIndex = xlNone End Sub
-
Highlight the column of the selected cell
Sub EP_1() With Columns(Selection.Column).Interior .ColorIndex = 6 .Pattern = xlSolid End With End Sub
-
Remove the highlight of the column of the selected cell
Sub EP_1() Columns(Selection.Column).Interior.ColorIndex = xlNone End Sub
Word
-
Paste the content of the clipboard as unformatted text
Sub EP_1() Selection.PasteSpecial DataType:=wdPasteText End Sub
-
Highlight selected text
Sub EP_1() Selection.Range.HighlightColorIndex = wdYellow End Sub
-
Remove the highlight on the selected text
Sub EP_1() Selection.Range.HighlightColorIndex = wdNoHighlight End Sub
-
Automatically add double quotes
Sub EP_1() Selection.InsertAfter Chr(34) Selection.InsertBefore Chr(34) End Sub
-
Display the number of words in the active document, including footnotes
Sub EP_1() MsgBox ActiveDocument.ComputeStatistics(Statistic:=wdStatisticWords, _ IncludeFootnotesAndEndnotes:=True) & " words" End Sub
-
Insert the current date
Sub EP_1() Selection.InsertDateTime Format(Now(), "yyyy-mm-dd") End Sub
-
Set bold font style
Sub EP_1() Selection.Font.Bold = True End Sub
-
Unset bold font style
Sub EP_1() Selection.Font.Bold = False End Sub
-
Set font color to red
Sub EP_1() Selection.Font.Color = wdColorRed End Sub
-
Remove color behind text
Sub EP_1() Selection.Font.Color = wdColorAutomatic End Sub
-
Insert the specified text (single line)
Sub EP_1() Selection.TypeText Text:="Text to insert" End Sub
-
Insert the specified text (multiple lines)
Sub EP_1() Selection.TypeText Text:="First line of text to insert" Selection.TypeText vbVerticalTab Selection.TypeText Text:="Second line of text to insert" End Sub
vbVerticalTab used at the end of line three emulates Shift+Enter (also known as manual line break, soft return). There will be no extra blank line to separate the two lines of inserted text.
vbNewLine (instead of vbVerticalTab) can be used to emulate a paragraph change. There will be an extra blank line to separate the two lines of inserted text.