Solved

Excel Formular to pull Footer

Posted on 2011-09-21
5
250 Views
Last Modified: 2012-05-12
The footnote contain information. Is there a formular that will pull the footnote?


Example: if the footnote said Boat 234, the formular would pick this up in a cell that is written with a formular.
0
Comment
Question by:Mighty1072
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 42

Accepted Solution

by:
dlmille earned 250 total points
ID: 36575095
In VBA, you can use:


ActiveSheet.PageSetup.LeftFooter, ActiveSheet.PageSetup.CenterFooter, and ActiveSheet.PageSetup.RightFooter
 

See example attached - I created a function you can use (copy Module1 to your workbook):

=getFooter(1) 'to get leftFooter (use 2 for center, and 3 for right)

here's the code:
 
Function getFooter(which As Integer)

    On Error GoTo errHandler
    
    Select Case which:
        Case 1:
            getFooter = ActiveSheet.PageSetup.LeftFooter
        Case 2:
            getFooter = ActiveSheet.PageSetup.CenterFooter
        Case 3:
            getFooter = ActiveSheet.PageSetup.RightFooter
        Case Else:
            getFooter = ""
    End Select
    
    Exit Function
    
errHandler:
    getFooter = ""
End Function

Open in new window


See attached.

Enjoy!

Dave
getFooter-UDF-r1.xls
0
 
LVL 5

Expert Comment

by:slycoder
ID: 36575475
After a small tweak to Dave's solution - you can return all three of them in a single call:

Function getFooter()

    'On Error GoTo errHandler
   
    getFooter = ""
   
    getFooter = ActiveSheet.PageSetup.LeftFooter & " " & _
                ActiveSheet.PageSetup.CenterFooter & " " & _
                ActiveSheet.PageSetup.RightFooter
   
    getFooter = Trim(getFooter)
   
    Exit Function
   
errHandler:
    getFooter = ""
End Function
0
 
LVL 5

Assisted Solution

by:slycoder
slycoder earned 250 total points
ID: 36575480
you would use

=getFooter()

to call this function.



Thanks
0
 

Author Closing Comment

by:Mighty1072
ID: 36576267
Not exactly what I am looking for. But I have found a different solution.

Thanks guys
0
 
LVL 42

Expert Comment

by:dlmille
ID: 36576302
That's great.  Please share your other solution.

Dave
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question