This commit is contained in:
louiscklaw
2025-03-16 01:19:45 +08:00
parent 8731a00f5e
commit 98fabcf849
139 changed files with 7851 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
Sub 儲存訂單()
Dim 品項數量 As Integer, 空白列 As Integer
品項數量 = WorksheetFunction.CountA(Sheets("訂單").Range("D10:D16"))
空白列 = Sheets("資料庫").Range("A1").CurrentRegion.End(xlDown).Offset(1, 0).Row
Sheets("訂單").Range("D10:G10").Resize(品項數量).Copy
Sheets("資料庫").Range("D" & 空白列).PasteSpecial xlPasteValues
Sheets("資料庫").Range("A" & 空白列).Resize(品項數量).Value = Sheets("訂單").Range("G6").Value
Sheets("資料庫").Range("B" & 空白列).Resize(品項數量).Value = Sheets("訂單").Range("G7").Value
Sheets("資料庫").Range("C" & 空白列).Resize(品項數量).Value = Sheets("訂單").Range("D5").Value
Call 重設表格
MsgBox "資料儲存完畢"
End Sub