Skip to content

Instantly share code, notes, and snippets.

@eikaaa
eikaaa / gist:bfc44059258142ef80a0834d67e079bb
Created January 15, 2026 15:08
自動執行powershell
Sub 一鍵合併執行PowerShell()
Dim cell As Range
Dim allCommands As String
Dim targetRange As Range
Dim count As Integer
' 1. 設定範圍與初始化
Set targetRange = Range("A1:A100")
allCommands = ""
count = 0
# 1. 設定來源資料夾
$sourcePath = "$home\Downloads"
# 2. 設定「關鍵字」對應的「目標資料夾」
$rules = @{
"*發票*" = "D:\財務整理\電子發票"
"*報告*" = "D:\工作項目\週報"
"*截圖*" = "C:\Users\User\Pictures\Screenshots"
}
@eikaaa
eikaaa / gist:c86e192228da124af6bb369988f0b38a
Last active January 18, 2026 12:53
packling list header
Sub AddCompanyHeaderFooter_Fixed_v3()
Dim ws As Worksheet
Dim lastRow As Long, lastCol As Long
Dim totalWidth As Double
Dim logoPath As String
Dim pic As Picture
Dim i As Integer
Dim footerStartRow As Long
' 如果沒開啟任何活簿則結束