+ Reply to Thread
Results 1 to 5 of 5

Insert row that copies formulas and formats from another row

  1. #1
    Registered User
    Join Date
    11-19-2012
    Location
    Iowa, USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Insert row that copies formulas and formats from another row

    I am very new to macros but i am trying to record a macro that will copy a specific row (row 500) and insert copied row into my current selected row or rows. When I record it, it makes the insert area static and always in the same spot. I want it to put it into the row i have selected when i hit my macro short cut. Any help is appreciated.

    Current Macro:
    Sub InsertRow()
    Rows("500:500").Select
    Selection.Copy
    Rows("52:52").Select
    Selection.Insert Shift:=xlDown
    End Sub

    I want the Rows("52:52") to my current selected row instead of always 52.
    Last edited by jas001; 11-26-2012 at 06:46 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: Insert row that copies formulas and formats from another row

    Please keep code in code tags.

    Try this.
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-19-2012
    Location
    Iowa, USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Insert row that copies formulas and formats from another row

    Awesome! That worked. Thank you so much. I am a rookie so how do I keep the code in code tags for future reference?

  4. #4
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: Insert row that copies formulas and formats from another row

    If the reply worked for you, please update the status of thread as [solved]


    -------------
    If my answer helped, you can click on the star and add to my reputation.

  5. #5
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: Insert row that copies formulas and formats from another row

    How to update the thread is given in forum rules. Click on Go Advanced and edit your thread to include code tags.

+ 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