Solved

Excel Formular to pull Footer

Posted on 2011-09-21
5
256 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

724 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