Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 "Nick" wrote: 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi...
thanks but the 2nd data and onward copy form A2 are not past at d2, follow d3 for 3rd data and next.... "Mike H" wrote: 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 "Nick" wrote: 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On 6 jan, 13:54, Nick wrote:
hi... thanks but the 2nd data and onward copy form A2 are not past at d2, follow d3 for 3rd data and next.... "Mike H" wrote: 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 "Nick" wrote: 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- Tekst uit oorspronkelijk bericht niet weergeven - - 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro program protect | Excel Programming | |||
how do i put a formula in a macro to run a program | Excel Worksheet Functions | |||
Some macro help with shelling out to other program | Excel Discussion (Misc queries) | |||
Macro to bring up Other Program | Excel Programming |