Showing posts with label macro. Show all posts
Showing posts with label macro. Show all posts

April 29, 2007

bug on excel 2007 macro?

below codes (simplified a bit) are ok run in excel 2003 but not in 2007, why?

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Cells(Target.Row, 7) = Cells(Target.Row, 2) * Cells(Target.Row, 4)
End Sub


run-time error -2147417848(80010108) is prompted (Method '_Default' of object '_Range' failed) and closed.