Excel VBA “Autofill Method of Range Class Failed”

后端 未结 4 899
醉梦人生
醉梦人生 2020-12-16 22:28

The following VBA code (Excel 2007) is failing with Error 1004, \"Autofill Method of Range Class Failed.\". Can anyone tell me how to fix it?

Dim src As Ran         


        
4条回答
  •  悲哀的现实
    2020-12-16 23:05

    If you want to autofill you just do something like...

    Private Sub Autofill()
    
    'Select the cell which has the value you want to autofill
    Range("Q2").Select
    
    'Do an autofill down to the amount of values returned by the update
    Selection.AutoFill Destination:=Range("Q2:Q10")
    
    End Sub
    

    This would autofill down to the specified range.

    Does ths help?

提交回复
热议问题