嘗試為表單上的提交按鈕運行此代碼,該表單應該將值插入 Excel 作業表,每次單擊它都會向下移動一行并再次插入值。雖然得到“438”錯誤。
Sub AddPromotionButton_Click()
Dim LR As Long
LR = Worksheets("New Promotion").cell(Rows.Count, 1).End(xlUp).Row 1
Range("A" & LR).Value = NameofPromotion.Value
Range("B" & LR).Value = InvoiceText.Value
Range("C" & LR).Value = ChildOffer.Value
Range("D" & LR).Value = FlatorPercentage.Value
Range("E" & LR).Value = DiscountRate.Value
Range("F" & LR).Value = OperatingCenter.Value
Range("G" & LR).Value = FTA.Value
Range("H" & LR).Value = MarketArea.Value
Range("I" & LR).Value = DurationofPromo.Value
Range("J" & LR).Value = StartDate.Value
Range("K" & LR).Value = EndDate.Value
Range("L" & LR).Value = GL.Value
End Sub
uj5u.com熱心網友回復:
改變這個...
LR = Worksheets("New Promotion").cell(Rows.Count, 1).End(xlUp).Row 1
……到這……
LR = Worksheets("New Promotion").Cells(Rows.Count, 1).End(xlUp).Row 1
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/422128.html
標籤:
上一篇:回圈瀏覽新舊版本的檔案
