This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) | |
Call Send_Email | |
End Sub | |
Private Sub Send_Email() | |
Dim olNS As Namespace | |
Dim olMail As MailItem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) | |
Call Save_Backup("<Your Backup Folder Directory>") | |
End Sub | |
Sub Save_Backup(ByVal Backup_Folder_Path As String) | |
Dim fso As Object | |
Dim ExtensionName As String, FileName As String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub Align_Buttons() | |
Dim obj As OptionButton | |
Dim x As Long, y As Long | |
x = 10 | |
y = 10 | |
For Each obj In ActiveSheet.OptionButtons | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from usps import USPSApi | |
from pprint import pprint as pp | |
userId = '<Your username>' | |
usps = USPSApi(userId) | |
trackingNumber1 = '9449011899223603092788' # valid | |
trackingNumber2 = '9449011899223603092781' # invalid | |
trackingNumber3 = '0114901055342164800018' # invalid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub Download_Attachments() | |
Dim ns As NameSpace | |
Dim olFolder_Inbox As Folder | |
Dim olMail As MailItem | |
Dim olAttachment As Attachment | |
Dim fso As Object | |
Dim Files_Saved_Folder_Path As String | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub Download_Attachments() | |
Dim ns As NameSpace | |
Dim olFolder_Inbox As Folder | |
Dim olMail As MailItem | |
Dim olAttachment As Attachment | |
Dim fso As Object | |
Dim Files_Saved_Folder_Path As String | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
myRecord = json.load(open('My Record.json')) | |
print(type(myRecord)) # return variable data type | |
print(myRecord) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
myRecord = { | |
'name': 'Hello WOrld', | |
'Age': 99, | |
'Occupation': 'Unemployeed' | |
} | |
j = json.dumps(myRecord) | |
with open('My Record.json', 'w') as f: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub Create_Worksheets() | |
Dim rowNumber As Long, LastRow As Long | |
Dim ws As Worksheet, wsList As Worksheet | |
Set wsList = ThisWorkbook.Worksheets("MyList") | |
With wsList | |
LastRow = .Cells(Rows.Count, "A").End(xlUp).Row | |
For rowNumber = 2 To LastRow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub Time_My_Macro() | |
Dim TimeStart As Double, TimeStop As Double, TotalTime As Double | |
Dim iCounter As Long | |
TimeStart = Timer | |
For iCounter = 1 To 50000000 | |
'Pass | |
Next iCounter |