macro program

  • Thread starter Thread starter Nick
  • Start date Start date
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
 
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
 
hi...

thanks but the 2nd data and onward copy form A2 are not past at d2, follow
d3 for 3rd data and next....
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top