+ Reply to Thread
Results 1 to 5 of 5

Macro issue

  1. #1
    Steved
    Guest

    Macro issue

    Hello from Steved

    Please how do I insert a row shift the cursor down one cell copy and then
    paste to the above. I got about 10,000 rows to do. Thankyou.

    Sub Broken()
    Selection.EntireRow.Insert
    Range("A61").Select
    Selection.Copy
    Range("A62").Select
    ActiveSheet.Paste
    End Sub


  2. #2
    Forum Contributor
    Join Date
    03-23-2006
    Location
    Vancouver
    Posts
    114

    Offset

    Try this:


    Sub Unbroken()

    Selection.EntireRow.Insert
    ActiveCell.Offset(1, 0).Copy
    ActiveCell.PasteSpecial


    End Sub

  3. #3
    Steved
    Guest

    Re: Macro issue

    Thankyou CaptainQuattro

    "CaptainQuattro" wrote:

    >
    > Try this:
    >
    >
    > Sub Unbroken()
    >
    > Selection.EntireRow.Insert
    > ActiveCell.Offset(1, 0).Copy
    > ActiveCell.PasteSpecial
    >
    >
    > End Sub
    >
    >
    > --
    > CaptainQuattro
    > ------------------------------------------------------------------------
    > CaptainQuattro's Profile: http://www.excelforum.com/member.php...o&userid=32763
    > View this thread: http://www.excelforum.com/showthread...hreadid=544940
    >
    >


  4. #4
    Bob Phillips
    Guest

    Re: Macro issue

    Sub InsertRows()
    Dim i As Long

    Application.ScreenUpdating = True
    For i = Cells(Rows.Count, "A").End(xlUp).Row To 1 Step -1
    Rows(i).Insert
    Rows(i + 1).Copy Cells(i, "A")
    Next i
    Application.ScreenUpdating = True
    End Sub


    --
    HTH

    Bob Phillips

    (remove xxx from email address if mailing direct)

    "Steved" <[email protected]> wrote in message
    news:[email protected]...
    > Thankyou CaptainQuattro
    >
    > "CaptainQuattro" wrote:
    >
    > >
    > > Try this:
    > >
    > >
    > > Sub Unbroken()
    > >
    > > Selection.EntireRow.Insert
    > > ActiveCell.Offset(1, 0).Copy
    > > ActiveCell.PasteSpecial
    > >
    > >
    > > End Sub
    > >
    > >
    > > --
    > > CaptainQuattro
    > > ------------------------------------------------------------------------
    > > CaptainQuattro's Profile:

    http://www.excelforum.com/member.php...o&userid=32763
    > > View this thread:

    http://www.excelforum.com/showthread...hreadid=544940
    > >
    > >




  5. #5
    Steved
    Guest

    Re: Macro issue

    Thankyou Bob.

    "Bob Phillips" wrote:

    > Sub InsertRows()
    > Dim i As Long
    >
    > Application.ScreenUpdating = True
    > For i = Cells(Rows.Count, "A").End(xlUp).Row To 1 Step -1
    > Rows(i).Insert
    > Rows(i + 1).Copy Cells(i, "A")
    > Next i
    > Application.ScreenUpdating = True
    > End Sub
    >
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > (remove xxx from email address if mailing direct)
    >
    > "Steved" <[email protected]> wrote in message
    > news:[email protected]...
    > > Thankyou CaptainQuattro
    > >
    > > "CaptainQuattro" wrote:
    > >
    > > >
    > > > Try this:
    > > >
    > > >
    > > > Sub Unbroken()
    > > >
    > > > Selection.EntireRow.Insert
    > > > ActiveCell.Offset(1, 0).Copy
    > > > ActiveCell.PasteSpecial
    > > >
    > > >
    > > > End Sub
    > > >
    > > >
    > > > --
    > > > CaptainQuattro
    > > > ------------------------------------------------------------------------
    > > > CaptainQuattro's Profile:

    > http://www.excelforum.com/member.php...o&userid=32763
    > > > View this thread:

    > http://www.excelforum.com/showthread...hreadid=544940
    > > >
    > > >

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1