Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 192
Default macro program

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default macro program

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 192
Default macro program

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default macro program

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro program protect Daniel Excel Programming 1 July 3rd 07 02:29 AM
how do i put a formula in a macro to run a program holy41 Excel Worksheet Functions 1 July 8th 06 02:34 AM
Some macro help with shelling out to other program Alan Excel Discussion (Misc queries) 1 February 22nd 05 09:24 PM
Macro to bring up Other Program Ryan Excel Programming 2 April 19th 04 09:11 PM


All times are GMT +1. The time now is 01:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"