• Merged Cells (2000)

    Author
    Topic
    #412673

    I have an Impromptu report that I save as Excel.
    The problem with this report is that the Report heading is below the column headings.
    (I had to fudge Impromptu to get the heading because usually the heading is dropped off)
    When I bring it into Excel, the report heading is smooshed into the first column.
    I manually merge the cells to spread the Report heading across all columns
    (If the heading takes up 3 rows then I have to merge each row separately).
    Then I have to move the Report heading to the top of the report before the column headings.
    Is there a simple macro where I could highlight the smooshed rows in the first column and the cells could merge and once merged, move it to the top of the report? The reason I hope this can be automated, is because I have 52 reports that need this done.
    Thanks for any help you can provide.

    Viewing 1 reply thread
    Author
    Replies
    • #904504

      Could you attach a demo, with dummy data, of what an imported report looks like?

      • #904508

        This is what it looks like after I merge the rows and before I copy the rows to the top of report. The actual reports have varied amounts of columns – way more than just 4 like the example.

        • #904516

          Something like this? Select the cells that will become the header – in your demo cells A2:D3 – and run the following macro:

          Sub FixHeader()
          Dim r As Range
          For Each r In Selection.Rows
          r.MergeCells = True
          Next r
          Selection.Cut
          Selection.Offset(-1, 0).Insert Shift:=xlDown
          End Sub

          • #904552

            Thank you Hans. It worked perfectly as usual.

            • #904606

              Thanks, Hans.

              My view on merged cells is that they should be avoided whenever possible. My alternative is to use “Center Across Selection” which effectively does the same, without the negatives of a merged cell (for further use of Excel capabilities).

            • #904618

              I didn’t bother pointing that out here, but I agree completely.

            • #904619

              I didn’t bother pointing that out here, but I agree completely.

            • #904607

              Thanks, Hans.

              My view on merged cells is that they should be avoided whenever possible. My alternative is to use “Center Across Selection” which effectively does the same, without the negatives of a merged cell (for further use of Excel capabilities).

          • #904553

            Thank you Hans. It worked perfectly as usual.

        • #904517

          Something like this? Select the cells that will become the header – in your demo cells A2:D3 – and run the following macro:

          Sub FixHeader()
          Dim r As Range
          For Each r In Selection.Rows
          r.MergeCells = True
          Next r
          Selection.Cut
          Selection.Offset(-1, 0).Insert Shift:=xlDown
          End Sub

      • #904509

        This is what it looks like after I merge the rows and before I copy the rows to the top of report. The actual reports have varied amounts of columns – way more than just 4 like the example.

    • #904505

      Could you attach a demo, with dummy data, of what an imported report looks like?

    Viewing 1 reply thread
    Reply To: Merged Cells (2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: