LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default Move lines from one sheet to another

try
If rTargetCell.Value = "" Then
iTgt = rTargetCell.Row
Sheets("Database").Range(iSource & ":" & iSource).cut _
Destination:=Sheets("archive").Range(iTgt & ":" & iTgt)
end if
If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Risky Dave" wrote in message
...
Hi,

I have a macro that is intended to find an entry on one sheet and cut and
pastes it into the next empty line on another sheet.

I am getting the dreaded runtime 1004 with the message "Cut method of
range
class failed"

The specific piece of code (part of a much larger macro) is:

If rTargetCell.Value = "" Then ' move database entry to Archive
iTgt = rTargetCell.Row
Sheets("Database").Range(iSource & ":"
&
iSource).cut_ Destination:=Sheets("archive").Range(iTgt & ":" & iTgt)
Worksheets("Database").Activate
Range("a" & iSource & ":ah" &
iSource).Select
Selection.Delete Shift:=xlUp

The error is being generated at the line that starts
Sheets("Database").Range......
All the appropriate variables have been set earlier.
I think I need to specifically activate the recipient sheet, but I'm not
sure how to do this (based on similar errors elsewhere in these forums).

Any suggestions would be gratefully received.

This is in Office 2003 under Windows 2000, if that makes a difference

TIA

Dave


 
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
Move bar chart to behind lines F[_2_] Charts and Charting in Excel 1 March 3rd 12 09:16 PM
inserted lines move how to place lines in proper cell? Deschi Excel Worksheet Functions 0 February 8th 09 01:15 PM
Can i move multiple lines between workbooks Martin Ellis New Users to Excel 11 September 18th 07 01:13 AM
How do I move lines one week up in a weekplan patrick meijer Excel Programming 0 May 16th 07 02:10 PM
how to move lines in conjunction with graphs Shoque Charts and Charting in Excel 4 July 25th 06 02:07 PM


All times are GMT +1. The time now is 05:56 PM.

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"