[ASP ] 執行錯誤438已刪文

看板Visual_Basic作者 (RR)時間5年前 (2019/07/31 12:24), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
執行巨集出現錯誤代碼438 內容如下,錯誤的地方為紅底部分,請各位幫忙看一下問題,謝謝。 Sub RandomSampleSelection() Range("Z1").Select ActiveCell.FormulaR1C1 = "Random" Range("Z2").Select ActiveCell.FormulaR1C1 = "=RAND()" Range("Z2").Select Selection.AutoFill Destination:=Range("Z2:Z" & Range("A" & Rows.Count).End(xlUp).Row) Range(Selection, Selection.End(xlDown)).Select ActiveWindow.SmallScroll Down:=-54 Cells.Select ActiveWorkbook.Worksheets("Random Sample Selection").Sort.SortFields.Clear ActiveWorkbook.Worksheets("Random Sample Selection").Sort.SortFields.Add2 Key:=Range("Z2:Z" & Range("A" & Rows.Count).End(xlUp).Row) _ , SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal With ActiveWorkbook.Worksheets("Random Sample Selection").Sort .SetRange Range("A:AA") .Header = xlYes .MatchCase = False .Orientation = xlTopToBottom .SortMethod = xlPinYin .Apply End With Dim myInputBoxVariable As Integer myInputBoxVariable = InputBox(Prompt:="How many rows?", Title:="Trim Data", Default:="1") myInputBoxVariable = myInputBoxVariable + 2 Rows(myInputBoxVariable & ":100000").Select Selection.Delete Shift:=xlUp Columns("Z:Z").Select Selection.Delete Shift:=xlToLeft Range("A1").Select End Sub Best Regards, Chieh Lin 林潔 保德信人壽整合支援部 TEL:(02)2767-8866 #2503 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 223.137.54.151 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Visual_Basic/M.1564547073.A.D39.html
文章代碼(AID): #1TGHW1qv (Visual_Basic)
文章代碼(AID): #1TGHW1qv (Visual_Basic)