Consulting

Results 1 to 2 of 2

Thread: Using a repeating bottom row as a footer

  1. #1

    Using a repeating bottom row as a footer

    I want my footer to be more than the max characters so I set it to as the last row of my sheet. But the italicize portion is not working, and hiding the last row is not working. Please help.


    [vba]Sub footer()

    n = Cells(Rows.Count, "e").End(xlUp).Row + 1
    Cells(n, "A").Value = String$(300,"X")
    Cells(n, "A").Font.Italic = True
    Cells(n, "b").Value = "column b"
    Dim StrFtr As String, Rng As Range, Sh As Worksheet, c As Range
    Set Sh = Worksheets("summary")
    Set Rng = Sh.Range(Cells(n, "a") & Sh.Cells(n, "b"))

    For Each c In Rng
    StrFtr = StrFtr & c & " "
    Next c

    ActiveSheet.PageSetup.LeftFooter = StrFtr

    Cells(n, "A").EntireRow.Hide = True
    End Sub
    [/VBA]

    Post Edited for readability Aug 14th 2009 12:04 PM
    ~Oorang
    Last edited by mzsuga; 07-27-2009 at 11:47 AM.

  2. #2
    Knowledge Base Approver VBAX Master Oorang's Avatar
    Joined
    Jan 2007
    Posts
    1,135
    Location
    Hello,
    I'm not sure I understand what you are trying to do here, but Italicization seems to be working fine for me. To hide the last row, you just do this:
    [VBA] Set ws = Excel.ActiveSheet
    ws.Rows(ws.UsedRange.Rows.Count).Hidden = True[/VBA]
    But if you try to put the cell value into the footer, it's value will still be truncated.
    Cordially,
    Aaron



    Keep Our Board Clean!
    • Please Mark your thread "Solved" if you get an acceptable response (under thread tools).
    • Enclose your code in VBA tags then it will be formatted as per the VBIDE to improve readability.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •