ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Moving row between worksheets (https://www.excelbanter.com/excel-programming/317530-moving-row-between-worksheets.html)

Steve1820

Moving row between worksheets
 

This is something which is bugging me, and I'm sure is simple but...

The user highlights a cell, then presses a button located at the top o
a worksheet, I then want to take that entire row and copy it to anothe
worksheet inserting it at the top of the page whilst deleting the ol
row on the other worksheet

So my plan was

ActiveCell.EntireRow.Copy
Worksheets("Completed").Activate 'the other sheet
Range("A1").Select
ActiveCell.Insert Shift:=xlShiftDown
WorkSheets("Active").Activate 'back to the original
ActiveCell.EntireRow.Delete Shift:=xlShiftUp

I get Run-time error '1004' Select method of Range class failed afte
selecting the other sheet, I've tried many other ways of selecting to
left, Cells, Rows etc with no luck. I have to state top left as it ma
not be there due to users selecting other cells for post updates and i
may not have the focus.

What am I overlooking??

Regards
Steve :confused

--
Steve182
-----------------------------------------------------------------------
Steve1820's Profile: http://www.excelforum.com/member.php...fo&userid=1672
View this thread: http://www.excelforum.com/showthread.php?threadid=31927


IC[_2_]

Moving row between worksheets
 
"Steve1820" wrote in message
...

This is something which is bugging me, and I'm sure is simple but...

The user highlights a cell, then presses a button located at the top of
a worksheet, I then want to take that entire row and copy it to another
worksheet inserting it at the top of the page whilst deleting the old
row on the other worksheet

So my plan was

ActiveCell.EntireRow.Copy
Worksheets("Completed").Activate 'the other sheet
Range("A1").Select
ActiveCell.Insert Shift:=xlShiftDown
WorkSheets("Active").Activate 'back to the original
ActiveCell.EntireRow.Delete Shift:=xlShiftUp

I get Run-time error '1004' Select method of Range class failed after
selecting the other sheet, I've tried many other ways of selecting top
left, Cells, Rows etc with no luck. I have to state top left as it may
not be there due to users selecting other cells for post updates and it
may not have the focus.

What am I overlooking??


I tried this on a new worksheet and it worked fine so the problem must be
elsewhere.

Ian



Steve1820[_2_]

Moving row between worksheets
 

Ian,

Thanks for your reply, following your lead I cut just this section ou
and into a new workbook. Unfortunately I had the same problem, i
failed on the Range.

Given that I'll look into any unusal things that are in my Exce
system.

Thanks for your help!

Stev

--
Steve182
-----------------------------------------------------------------------
Steve1820's Profile: http://www.excelforum.com/member.php...fo&userid=1672
View this thread: http://www.excelforum.com/showthread.php?threadid=31927



All times are GMT +1. The time now is 07:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com