Results 1 to 2 of 2

Thread: cut and paste

  1. #1
    Join Date
    Apr 2006
    Posts
    47

    Unanswered: cut and paste

    i am trying to cut colm a and paste after last colm, i get an error with my code

    Dim i As Integer

    Range("A:A").Cut

    i = ActiveSheet.UsedRange.Columns.Count + 1
    Columns(0, i).PasteSpecial xlPasteAll

  2. #2
    Join Date
    Jun 2006
    Posts
    103
    Quote Originally Posted by MikeroSoft
    i am trying to cut colm a and paste after last colm, i get an error with my code

    Dim i As Integer

    Range("A:A").Cut

    i = ActiveSheet.UsedRange.Columns.Count + 1
    Columns(0, i).PasteSpecial xlPasteAll
    try this:

    Private Sub cutAndPaste()
    Dim i As Integer

    Worksheets("Sheet1").Select
    ActiveSheet.Range("A:A").Cut
    i = ActiveSheet.Range("A1").End(xlToRight).Column
    ActiveSheet.Range("A1").Select
    ActiveCell.Offset(0, i + 1).Select
    ActiveSheet.Paste

    End Sub
    Hope this helps
    Last edited by mkggoh; 07-05-06 at 22:00.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •