|
楼主 |
发表于 2015-1-16 17:25
|
显示全部楼层
找到了一个编码,但是复制的只是上面的内容,不是上面的公式,不知道该如何调试,求高手解答调试
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
With Target
If .Row = 1 And .Cells(1, 1) <> "" Then Exit Sub
If .Cells(0, 1) = "" Then Exit Sub
Dim c As Range, rg As Range
Set rg = Application.Intersect(.Rows(0).EntireRow, .Worksheet.UsedRange)
If rg Is Nothing Then Exit Sub
Application.ScreenUpdating = False
Application.EnableEvents = False
For Each c In rg
If c.HasFormula = True Then c.Resize(2).FillDown
Next
Application.EnableEvents = True
Application.ScreenUpdating = True
End With
End Sub |
|