ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Cut&Paste Macro (https://www.excelbanter.com/excel-worksheet-functions/21128-cut-paste-macro.html)

[email protected]

Cut&Paste Macro
 
I need a Cut and Paste macro which will cut every second row (A2,A4,
etc) and Paste them to a destination (E1,E3, etc) one by one.

So A2 will be cut and pasted to E1, A4 to E3, etc etc. For the range
A2 to A100. If you can add an option to delete rows 2, 4, 6 etc after
the process it will also be appreciated.

TIA

JK

Don Guillett

Wouldn't it be easier to delete the rows first and then copy

--
Don Guillett
SalesAid Software

wrote in message
...
I need a Cut and Paste macro which will cut every second row (A2,A4,
etc) and Paste them to a destination (E1,E3, etc) one by one.

So A2 will be cut and pasted to E1, A4 to E3, etc etc. For the range
A2 to A100. If you can add an option to delete rows 2, 4, 6 etc after
the process it will also be appreciated.

TIA

JK




[email protected]

If you delete the row it's gone, how do you plan then to copy it?

On Fri, 8 Apr 2005 07:25:26 -0500, "Don Guillett"
wrote:

Wouldn't it be easier to delete the rows first and then copy



Duke Carey

You can't really paste a whole row to column E. Are you looking to copy
columns A:D & paste them to column E ?

" wrote:

I need a Cut and Paste macro which will cut every second row (A2,A4,
etc) and Paste them to a destination (E1,E3, etc) one by one.

So A2 will be cut and pasted to E1, A4 to E3, etc etc. For the range
A2 to A100. If you can add an option to delete rows 2, 4, 6 etc after
the process it will also be appreciated.

TIA

JK


[email protected]

Sorry, actually only a Cell, for example: Cut Cell A2 and Paste to E1
then Cut Cell A4 and Paste to E3 etc etc. This should be done for 100
cells thus from A2 al the way to A100. One by one.

On Fri, 8 Apr 2005 06:29:04 -0700, "Duke Carey"
wrote:

You can't really paste a whole row to column E. Are you looking to copy
columns A:D & paste them to column E ?

" wrote:

I need a Cut and Paste macro which will cut every second row (A2,A4,
etc) and Paste them to a destination (E1,E3, etc) one by one.

So A2 will be cut and pasted to E1, A4 to E3, etc etc. For the range
A2 to A100. If you can add an option to delete rows 2, 4, 6 etc after
the process it will also be appreciated.

TIA

JK



Duke Carey

Why can't you just copy that range of cells and paste them to E1? Are there
intervening cell entries?

After moving them, do you want the cells cleared or the rows deleted

Tough to divine just what you want done

Here's code that will 'move' the cells

Dim x As Integer, y As Integer

y = 1
For x = 2 To 100 Step 2
Cells(x, 1).Copy (Cells(y, 5))
Cells(x, 1).Clear
y = y + 2
Next x

The line
Cells(x, 1).Clear
will wipe out the cells after they've been copied


" wrote:

Sorry, actually only a Cell, for example: Cut Cell A2 and Paste to E1
then Cut Cell A4 and Paste to E3 etc etc. This should be done for 100
cells thus from A2 al the way to A100. One by one.

On Fri, 8 Apr 2005 06:29:04 -0700, "Duke Carey"
wrote:

You can't really paste a whole row to column E. Are you looking to copy
columns A:D & paste them to column E ?

" wrote:

I need a Cut and Paste macro which will cut every second row (A2,A4,
etc) and Paste them to a destination (E1,E3, etc) one by one.

So A2 will be cut and pasted to E1, A4 to E3, etc etc. For the range
A2 to A100. If you can add an option to delete rows 2, 4, 6 etc after
the process it will also be appreciated.

TIA

JK





All times are GMT +1. The time now is 01:52 AM.

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