PDA

View Full Version : ActiveSheet.Paste Error



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

GTO
08-18-2009, 01:59 PM
Greetings Manabug,

Welcome to the Forum :-)

Have you modified the other guy's code at all?

If no, ensure that there's still a sheet named "Land" - and rid the space between the 'd' and the closing quote mark in your posted code.

Pretty much guessing it won't be anything that easy, if things still go KABOOM!, I would suggest making a copy of the workbook, obfuscating any sensitive/private data, and post the example wb.

Mark

Norie
08-19-2009, 06:22 AM
Don't use ActiveSheet.Paste.:)