macro program

N

Nick

hi ,
i have data at cell A2. I want to create macro to cut and paste my data to
coloum D1 and for next data at A2 the macro will cut and paste at D2 and so
on..
Can any one of u can help me on this....

thanks in advance.

rgds
Nick
 
M

Mike H

Nick,

This could be done without a macro but I assume you want one for a
particular reason so try this. Right click your sheet tab, view code and
paste this in and run it

Sub Stantial()
Lastrow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
Set MyRange = Range("A2:A" & Lastrow)
For Each c In MyRange
c.Offset(, 3).Value = c.Value
c.ClearContents
Next
End Sub

Mike
 
N

Nick

hi...

thanks but the 2nd data and onward copy form A2 are not past at d2, follow
d3 for 3rd data and next....
 
R

RadarEye

hi...

thanks but the 2nd data and onward copy form A2 are not past at d2, follow
d3 for 3rd data and next....







- Tekst uit oorspronkelijk bericht weergeven -

Hi Nick,

In excel2003 I have created an other method:

Sub NicksMove()
Dim lastrow As Long
lastrow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
If lastrow > 1 Then
Range("A2:A" & lastrow).Select
Selection.Cut
Range("D2").Select
ActiveSheet.Paste
End If
End Sub

HTH,

Wouter
 
Top