+ Reply to Thread
Results 1 to 6 of 6

Insert Rows Based on Location

  1. #1
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Insert Rows Based on Location

    Good morning, All,

    In the attached sample workbook, how would you code to insert two blank rows between the locations every time the location changes? I plan to use the first of these rows to add a total, and the 2nd just creates seperation.

    Thanks in advance!

    Hutch
    Attached Files Attached Files

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Once you start adding rows, especially blank rows you will lose the database fuctionality of the table. Why not use a PivotTable or the subtotal Function?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706
    Thanks for the reply, Roy.

    This sheet isn't the database, it's the results of a filter on the database. A large range of data in another workbook is filtered on a date. The results are pasted into this "details" worksheet. The blank rows are actually desirable, other than for clarity, because I will probably have to "find" these averages later, in another macro.

    Is there any way to insert the blank rows based on a change in location name?

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    The subtotal function would do it &could be inserted in your Macro. It wouldn't have the blank rows, but the subtotals would stand out. Try it manually first.
    Last edited by royUK; 08-01-2008 at 04:35 PM.

  5. #5
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706
    That may work, Roy. How would I remove the subtotals after I've completed all my processes, so that the sheet is ready to import the raw data for the next week?

  6. #6
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706
    Never mind, Roy. I found it.

    Data/Subtotals/Remove All

+ 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