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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cut/Paste Macro

Status
Not open for further replies.

TheRealDeal

Technical User
Nov 16, 2001
187
US
How would I cut 5 cells from 1 row and paste them up 1 row and over 6 columns? Finally, how would I move back to cut-cell row and delete it?
 
Hi,

Turn on your macro recorder and do it, for a start.

Then post back with your code.

Skip,

[glasses] [red]Be advised:[/red] The dyslexic, agnostic, insomniac, lays awake all night wondering...
"Is there really a DOG?" [tongue]
 
I was able to gleen this from several sources to make this work for me. Would you have a better method?

Sub CutCells()
Range(ActiveCell, ActiveCell.Offset(0, 4)).Select
Selection.Cut Destination:=Cells(ActiveCell.Row - 1, ActiveCell.Column + 8)
ActiveCell.EntireRow.Delete
End Sub
 
Code:
Sub CutCells()
    With Range(ActiveCell, ActiveCell.Offset(0, 4))
        .Copy Destination:=Cells(ActiveCell.Row - 1, ActiveCell.Column + 8)
        .EntireRow.Delete
    End With
End Sub
How Can I Make My Code Run Faster? faq707-4105

Skip,

[glasses] [red]Be advised:[/red] The dyslexic, agnostic, insomniac, lays awake all night wondering...
"Is there really a DOG?" [tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top