+ Reply to Thread
Results 1 to 2 of 2

Inserting Lines

  1. #1
    Registered User
    Join Date
    05-11-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    15

    Inserting Lines

    Good morning all

    I've got a macro here that subtotals the number of cases and weight for each store in a list of many stores. Each store will have a different number of lines, based on the number of different products they are getting. After I subtotal, I insert rows 1 & 2 and need to write a couple of things in those lines.

    What I want to do is insert rows one and two directly below the subtotal rows. I think that the problem is happening in my "INSTR" line close to the bottom of the macro.

    Anyones help is greatly appreciated.


    Please Login or Register  to view this content.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,750

    Re: Inserting Lines

    Quote Originally Posted by GMOODY View Post
    I think that the problem is happening in my "INSTR" line close to the bottom of the macro.
    What problem? Not sure what to try to fix for you....


    At any rate here is a cleaned up version of your code, and there is clearly one problem at the line you mention, see below.

    When you record a macro in Excel, the resulting code tends to be cluttered and inefficient. That's mostly because Excel can't guess at what you are going to do next. In particular, it is not necessary to Select a cell then refer to the Selection to operate on it; you can just refer to the cell straight away. This version declutters the Excel macro.

    Please Login or Register  to view this content.
    Last edited by 6StringJazzer; 06-01-2010 at 02:55 PM. Reason: Figured out what was going on with the Copy
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ 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