Wrox Programmer Forums
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old December 11th, 2003, 04:13 PM
Friend of Wrox
Join Date: Sep 2003
Posts: 451
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Ben Horne
Default A Bit Of A Problem

Hi all,

I hope y'all can help me out with this problem. I am working on programming an Excel spreadsheet with the HeaderFooter procedure. This is how the code looks:

'HeaderFooter Procedure
'Procedure to customize the header and footer
Sub HeaderFooter()
    'Inserts the filename in the header
    Worksheets("January 2003").PageSetup.CenterHeader = "&F"
    'Declares the variable LeftFooterText as a string
    Dim LeftFooterText As String
    'Prompts user for left footer text
    LeftFooter = InputBox("Enter your full name:")
    'Inserts response into left footer
    Worksheets("January 2003").PageSetup.LeftFooter = LeftFooterText
    Worksheets("January 2003").PageSetup.CenterFooter = ""
    'Inserts the date into right footer
    Worksheets("January 2003").PageSetup.RightFooter = "&D"
End Sub

My problem is that I can't seem to get my name to display on the left-side footer of the spreadsheet in Print Preview. Anybody got a clue as to what could be wrong with the code?

Thanks in advance,

Ben Horne
Madison Area Technical College student

Go there. I have a lot of awesome photos that I rendered myself
Ben Horne
I don\'t want to sound like I haven\'t made any mistakes. I\'m confident I have.

Most likely using FireFox and concocting my next Macromedia Flash project
Snibworks Forums Moderator

Welcome to the New Age
Old December 12th, 2003, 12:55 AM
Authorized User
Join Date: Nov 2003
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts

You declared the variable with the name 'LeftFooterText'. Then your input box references "LeftFooter". Change that to "LeftFooterText" and the string should appear.

Similar Threads
Thread Thread Starter Forum Replies Last Post
64 Bit - Issue in 64 bit IIS calling Win32 API Hubman General .NET 1 August 24th, 2006 09:19 AM
Getting Bit value from datareader. DittoToo ADO.NET 1 May 25th, 2006 11:19 AM
A bit concerned JoanW BOOK: Accessible XHTML and CSS Web Sites: Problem Design Solution 1 April 24th, 2006 08:24 AM
bit error! sxbluebird BOOK: Professional C#, 2nd and 3rd Editions 0 February 10th, 2004 06:03 AM
Bit Operation in C#? oatcpe C# 1 August 15th, 2003 03:51 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.