Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Button to move row and delete old row
I've created a button at the top of a spreadsheet that says "Move Row to
Tracking Tab". When this button is clicked, I want it to move the current row (where their cursor is), to the Tracking Tab, and add it either at the top of the spreadsheet (under the header row) or to the very bottom, while at the same time, it deletes the old row from the first sheet entirely. The first cell that contains data on the Tracking Tab is A4. Everything above that is the header. (And just in case you need to know, the first tab is titled "Western", and they are the only 2 tabs in the workbook) I've tried the following code, but cant get it to work out right. It's giving me fits with the line "Range("A4").Select", and I'm not really sure why. Here is the code I used: Private Sub MoveRow_Click() ActiveCell.EntireRow.Copy Worksheets("Tracking").Activate 'the other sheet Range("A4").Select ActiveCell.Insert Shift:=xlShiftDown Worksheets("Western").Activate 'back to the original ActiveCell.EntireRow.Delete Shift:=xlShiftUp End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Button macro to move/delete active row | Excel Discussion (Misc queries) | |||
Any way to use toolbar button to delete cells and move cells "up"? | Excel Discussion (Misc queries) | |||
How can I delete a macro when the Delete button is not active? | Excel Worksheet Functions | |||
Delete every 3rd row, then delete rows 2-7, move info f/every 2nd row up one to the end and delete the row below | Excel Programming | |||
Delete a custom button by holding down the ALT key and dragging the button off the toolbar | Excel Programming |