+ Reply to Thread
Results 1 to 1 of 1

Formula/Macro to Move Subheadings to Applicable Rows for Pivot Table?

  1. #1
    Registered User
    Join Date
    08-10-2011
    Location
    Cali
    MS-Off Ver
    Excel 365
    Posts
    62

    Formula/Macro to Move Subheadings to Applicable Rows for Pivot Table?

    So Hopefully I have describe this properly.

    I have some (lots, 19,000 rows) data that exports from a system we use at work. Unfortunately, rather than just dumping into a nice pretty table, it has a bunch of sub-headings occupying single cells as you move through the data. For example, Column A might look like this:
    Subheading1
    Data1.1
    Data1.2
    Data1.3
    Dta1.4
    Data1.5
    Subheading2
    Data2.1
    Data2.2
    Data2.3
    Data2.5
    Data2.5


    etc etc.

    What I need to do is manipulate this data so that it can easily drop into a pivot table to summarize a few different ways, but this (and some other) annoying formatting is causing issues. What I would like is a formula or macro that would make the data set look like this:

    Subheading Description
    Subheading1 Data1.1
    Subheading1 Data1.2
    Subheading1 Data1.3
    Subheading1 Data1.4
    Subheading1 Data1.5
    Subheading2 Data2.1
    Subheading2 Data2.2
    Subheading2 Data2.3
    Subheading2 Data2.4
    Subheading2 Data2.5

    So basically I create a new column so the initial data is now in column B and in Column A, it drags out the subheading from Column B, deletes the line that the subheading was on, and fills the subheading down to all data points (rows) that were under the subheading, and does this until it encounters the next subheading at which point it stops filling down subheading1 and repeats the process for subheading2.

    Basically there are a bunch of useless dummy rows (and other stuff I haven't tackled yet) in the data set and I need to pull them out but apply the subheading label to an adjacent column so that I can still sort by that categorization in a pivot table.
    Last edited by Norcal1; 09-19-2017 at 02:37 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Chart to move up or down with the rows of the pivot table?
    By GRG Stevan in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 11-08-2017, 07:07 AM
  2. Replies: 1
    Last Post: 09-06-2016, 04:59 AM
  3. Replies: 6
    Last Post: 07-29-2014, 11:10 AM
  4. [SOLVED] Macros To Move Multiple Rows To Another Sheet And Macro To Move Single Rows To DAX Table
    By jcaynes in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-22-2013, 05:08 PM
  5. Replies: 8
    Last Post: 12-19-2012, 09:52 AM
  6. Replies: 1
    Last Post: 08-31-2012, 09:52 PM
  7. [SOLVED] How do I move rows in a pivot table?
    By Tiff in forum Excel General
    Replies: 2
    Last Post: 02-24-2005, 03:06 PM

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