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
Sub Draft_An_Email()
Dim olMail As MailItem
Dim My_Email_Account As Account
Set My_Email_Account = Session.Accounts("<Your Email Account Address>")
Set olMail = CreateItem(olMailItem)
With olMail
import os
folderPath = r'<Folder Path>'
fileSequence = 1
for filename in os.listdir(folderPath):
os.rename(filename, 'NewFileName_' + str(fileSequence))
fileSequence +=1
Option Explicit
Dim fso As Object
Dim Folder_Path As String
Private Sub Init()
Set fso = CreateObject("Scripting.FileSystemObject")
Folder_Path = "<Your Folder Path>"
import os
folderPath = r'<Your Folder Path>'
fileNumber = 1 # file sequence number
for filename in os.listdir(folderPath):
os.rename(filename, 'Your file name' + str(fileNumber))
fileNumber +=1
Sub Find_Previous_Demo()
Dim fc As Range
Set fc = Columns("C").Find("red")
Debug.Print fc.Address
Set fc = Columns("C").FindNext(fc)
Debug.Print fc.Address
Set fc = Columns("C").FindPrevious(fc)
Sub Lookup_Demo()
Dim ColorName As String, firstAddress As String
Dim rangeLookup As Range, rangeOutput As Range
Dim v As Range
ColorName = "Red"
Set rangeLookup = Range("C3:C8")
Set rangeOutput = Range("D3:D8")
import matplotlib.pyplot as plt
from matplotlib.widgets import LassoSelector
fig, ax = plt.subplots()
def onSelect(x):
print(x)
def onPress(event):
print('Mouse pressed')
from datetime import datetime
import xlsxwriter as xw
expenses = (
['Rent', '2019-05-01', 1500],
['Gas', '2019-05-15', 20.50],
['Grocery', '2019-05-16', 100],
['Phone Bill', '2019-05-21', 59.99],
)
import xlsxwriter as xw
wbFormatTable = xw.Workbook('Format Table.xlsx')
wsTransaction = wbFormatTable.add_worksheet('Transactions')
transactions = (
['5/1/2019', 'Buy', 100.00],
['5/2/2019', 'Sell', 200.00],
['5/3/2019', 'Buy', 300.00],
['5/4/2019', 'Sell', 400.00],
import xlsxwriter as xw
wbTransaction = xw.Workbook('Transaction Table.xlsx')
wsTransaction = wbTransaction.add_worksheet('Transactions')
transactions = (
['Tran Date', 'Tran Type', 'Tran Amount'],
['5/1/2019', 'Buy', 100.00],
['5/2/2019', 'Sell', 200.00],
['5/3/2019', 'Buy', 300.00],