軟體:excel
版本:2013
程式碼如下
Dim maxR As Long
Dim sh As Worksheet
Set sh = ActiveSheet
maxR = 2
While sh.Cells(maxR, 1).Value <> ""
maxR = maxR + 1
Wend
maxR = maxR - 1
ref1 = "AP2:BT" & maxR ‘→要複製的範圍
Selection.AutoFill Destination:=Range(ref1) =>錯誤點
MsgBox ("完成!")
一直找不到怎麼解決,懇請大大指點