+ Reply to Thread
Results 1 to 6 of 6

Incrementing Rows in a Macro

  1. #1
    Registered User
    Join Date
    04-30-2013
    Location
    Cranfield
    MS-Off Ver
    Excel 2007
    Posts
    68

    Incrementing Rows in a Macro

    Hi all,

    I have written a very simple macro for the attached worksheet to add a new row and copy the formatting from the row below and then clear it ready for data entry.

    As you can see, there will be options for new Plans, Pros and Data but I can't write the macro in the same way as it is using specific rows and any new Notices force the rest of the worksheet down by one.

    Is there a way to tell these macros to look for the correct row and then insert, copy and clear?

    Thanks a lot.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Incrementing Rows in a Macro

    JamesFletcher,

    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).


    In the New_Notice macro:

    Please Login or Register  to view this content.
    Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension .xlsm

    Then test the New_Notice macro by clicking on the New Notice button.
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  3. #3
    Registered User
    Join Date
    04-30-2013
    Location
    Cranfield
    MS-Off Ver
    Excel 2007
    Posts
    68

    Re: Incrementing Rows in a Macro

    Thank you but the New Notice macro isn't the problem. If I wrote a macro for new Plan, Pro, or Data, I can't tell it a specific row as it may not be e.g. row 41 I want to insert the new row.

  4. #4
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Incrementing Rows in a Macro

    JamesFletcher,

    In the Quick Reply box, just put the word BUMP. Then, click on the Post Quick Reply button, and someone else will assist you.

  5. #5
    Registered User
    Join Date
    04-30-2013
    Location
    Cranfield
    MS-Off Ver
    Excel 2007
    Posts
    68

    Re: Incrementing Rows in a Macro

    Thanks Stanley, it took a few helping hands but I figured it out in the end.
    FYI here is the code I used:
    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Incrementing Rows in a Macro

    JamesFletcher,

    I am glad that you were able to come up with a solution.

+ 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