Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro help copy&paste

Status
Not open for further replies.

paulmtl

Programmer
Feb 25, 2005
27
CA
Hi all,

I created a macro16() to copy and paste as you can see below but always copied to the same row means the first row

How to correct this macro to copy to second row and so on...?

row1 john doe
row1 brian die

to get :

row1 john doe
row2 brian die

Thanks in advance,

the codes by macro are:

Sub Macro16()
'
' Macro16 Macro
' Macro recorded 5/10/2005 by user1

Range("K7").Select
Selection.Copy
Range("B2").Select
ActiveSheet.Paste
Range("K9").Select
Application.CutCopyMode = False
Selection.Copy
Range("C2").Select
ActiveSheet.Paste
Range("K11").Select
Application.CutCopyMode = False
Selection.Copy
Range("D2").Select
ActiveSheet.Paste
Range("K13").Select
Application.CutCopyMode = False
Selection.Copy
Range("E2").Select
ActiveSheet.Paste
Range("K15").Select
Application.CutCopyMode = False
Selection.Copy
Range("H2").Select
ActiveSheet.Paste
End Sub
 
What exactly are you tring to accomplish?

Do you need to reorder the data?

I created a macro16() to copy and paste as you can see below but always copied to the same row means the first row

How to correct this macro to copy to second row and so on...?
[\quote]
What do you mean??

Are the default copy and paste commands in excel not enough?

Kevin Petursson
 

hi,
Code:
Sub Macro16()
'
' Macro16 Macro
' Macro recorded 5/10/2005 by user1
    for each r in range(cells(7, "K"), cells(15, "K"))
       if r.value <> "" then
         lRow = Cells(65536, "B").end(xlup).row + 1
         r.Copy cells(lRowm "B")
       end if
    Next
End Sub


Skip,
[sub]
[glasses] [red]Be advised:[/red]When Viscounts were guillotined just as they were disclosing where their jewels were hidden, it shows to go that you should...
Never hatchet your Counts before they chicken! [tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top