Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default runtime error '1004' delete Method of Range Class Failed

How are you triggering the code - if with a commandbutton, try changing the
takefocusonclick property to false - just a guess of course.

--
Regards,
Tom Ogilvy

"Jack" wrote in message
...
Hi,

I copy and paste from a worksheet to another. It works
well on excel2000 but not on excel97--runtime
error '1004' delete Method of Range Class Failed. Does it
means the versions are not compatible?.Do you know what is
wrong?!

this is what the button has:

Dim ExecComments As Worksheet
Set ExecComments = Sheets("Comments")

Dim Answers As Worksheet
Set Answers = Sheets("Sheet1")

'delete column
ExecComments.Columns(1).EntireColumn.Delete

request = InputBox("Please enter the question number to
see the comments (1-4)", "", "")

' Find the last row of data
FinalRow = Answers.Range("A65536").End(xlUp).Row


' Loop through each row
For X = 1 To FinalRow

thisValue = Answers.Range("F" & X).Value
If thisValue = "1" Then
thisValueComments = Answers.Range("Z" &
X).Value
If Not thisValueComments = "[NULL]" Then
Answers.Range("Z" & X).Copy

NextRow = NextRow + 2
If flag = 1 Then
ExecComments.Range("A12").Value = "QUESTION
1. what team you have? "
flag = 0
End If

ExecComments.Range("A" & NextRow).Value =
thisValueComments

End If
End If
Next X

Thanks for your help!!!
Jack



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run-time error '1004': AutoFill method of Range class failed murkaboris Excel Discussion (Misc queries) 10 April 16th 09 09:06 PM
Runtime 1004 error -- insert method of range class failed. tish Excel Discussion (Misc queries) 1 June 1st 07 04:04 PM
runtime error 1004 method range of object '_global failed valdesd Excel Discussion (Misc queries) 2 October 6th 05 07:26 PM
excel97: runtime error 1004 select method of range class failed JMCN Excel Programming 4 December 25th 03 05:32 AM
error 1004 Select method of Range class failed J.E. McGimpsey Excel Programming 1 September 12th 03 07:42 PM


All times are GMT +1. The time now is 10:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"