ManaBuG
08-18-2009, 12:44 PM
Hi I'm a total VBA newbie. My job requires me though to be build a Excel macro that sorts different data.
I think the guy that works at my position before has built a macro already. However when I try to use it now, it doesn't work anymore.
Here is part of the codes, and the msgbox shows that the error is at the ActiveSheet.Paste. The error is "Run-time error '1004': Paste method of Worksheet class failed". Can someone please help me figure this out? I've been recording macros by myself but they never work out. Please let me know if you need more information.
ElseIf Cells(count, "D") = "L" Then
Rows(count).Copy
Rows(count).Font.Bold = True
Sheets("Land ").Select
Rows(land).Select
ActiveSheet.Paste
Cells(land, "I") = Cells(land, "C") - Cells(land, "F")
land = land + 1
I think the guy that works at my position before has built a macro already. However when I try to use it now, it doesn't work anymore.
Here is part of the codes, and the msgbox shows that the error is at the ActiveSheet.Paste. The error is "Run-time error '1004': Paste method of Worksheet class failed". Can someone please help me figure this out? I've been recording macros by myself but they never work out. Please let me know if you need more information.
ElseIf Cells(count, "D") = "L" Then
Rows(count).Copy
Rows(count).Font.Bold = True
Sheets("Land ").Select
Rows(land).Select
ActiveSheet.Paste
Cells(land, "I") = Cells(land, "C") - Cells(land, "F")
land = land + 1