Skip to content

Instantly share code, notes, and snippets.

View DataSolveProblems's full-sized avatar
💭
Github Working In Progress

Jie Jenn DataSolveProblems

💭
Github Working In Progress
View GitHub Profile
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
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
Sub Align_Buttons()
Dim obj As OptionButton
Dim x As Long, y As Long
x = 10
y = 10
For Each obj In ActiveSheet.OptionButtons
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
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
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
import json
myRecord = json.load(open('My Record.json'))
print(type(myRecord)) # return variable data type
print(myRecord)
import json
myRecord = {
'name': 'Hello WOrld',
'Age': 99,
'Occupation': 'Unemployeed'
}
j = json.dumps(myRecord)
with open('My Record.json', 'w') as f:
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
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