+ Reply to Thread
Results 1 to 7 of 7

Macros run from selected cell

  1. #1
    Registered User
    Join Date
    10-10-2012
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    3

    Macros run from selected cell

    Hello, I am trying to run a macro to insert 16 rows at the point I have selected with the arrow buttons.

    So far I have only been able to get the rows inserted at the top of the worksheet, where I recorded the macro the first time.

    I have a large list of numbers (716 rows). Each row needs 16 rows inserted; then the original cell copied over the start of the 16 inserted rows. Then a selection of data from a different worksheet copied onto those 16 rows.
    I would like it to end and the point of the next insertion so I can simply runt the macro 716 times to complete the insertion.

    I am creating data which will be inserted back into a database.
    Also, I am working in Excel 2003

    Thanks

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Macros run from selected cell

    If you just want insert 16 rows from activecell, try

    Please Login or Register  to view this content.

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Macros run from selected cell

    Where is the next point of insertion?

  4. #4
    Registered User
    Join Date
    10-10-2012
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Macros run from selected cell

    I am new to macros so I don't understand where this subroutine goes.

    I have used the record option to create each step from the insertion to the copying of the other cells to the ending location.

    Are you suggesting I insert this subroutine into the one I am using?

    If I had the syntax to cause the subroutine to go from the selected cell, I would select the cell at the location of the next insertion and then run the shortcut Control^w to start the macro.

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Macros run from selected cell

    You mentioned you wanted to run this code 716 times.

    Where do you want it to run each time?

    Is there some sort of criteria or pattern?

  6. #6
    Registered User
    Join Date
    10-10-2012
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Macros run from selected cell

    OK, I have had progress since the last post. I simply cut the rows from the top of the list and inserted them at the bottom of the list. This allows the macro to keep running at the top (the way it is working).

    Now I would like to know how to create a loop so I can make the macro run the 716 then stop. It is probably simple, but any help would be nice.

    Thanks,

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Macros run from selected cell

    How do you know to loop 716 times?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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