LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 489
Default I need an Excel Genius !!!!!!!!!!!!!!! Headers/Footer Changes

I think I need some work around code. I have two workbooks named QG and
Add-In. Add-In contains all the code to manipulate data in QG. I have two
option buttons in Sheets("QUOTE") in QG. Each option button represents a
company. When an option button is clicked the code below located in Add-In
is called, which changes the Header and Footer to represent that company.
The code works fine, but there is a fault. If the Logo is moved to a
different folder the code fails.

Is there a way to store the two company logos (.jpeg) in one of the
workbooks so that when one of the option buttons are clicked the appropriate
company logo will be displayed in the left header?

Sub HeaderFooterChanger()

Dim strLogoFileName As String
Dim strRightHeader As String
Dim strCenterFooter As String

Application.ScreenUpdating = False

With Sheets("QUOTE")

' which option button is true
' Constants Enumeration: xlOn = 1 and xlOff = -4146
Select Case xlOn

' Ad Tech
Case .OptionButtons("optAdTech").Value

strLogoFileName = "\\cdc.gov\private\M131\iqz9\Ad
Tech\Temporary\Ad Tech Logo.jpg"

strRightHeader = "&""-,Bold""QUOTATION / SALES AGREEMENT" &
Chr(10) & _
"&""-,Regular""Ad-Tech International, Inc."
& Chr(10) & _
"2963 Pleasant Hill Road" & Chr(10) & _
"Duluth, GA 30096" & Chr(10) & _
"PH 770-209-9102, Fax 770-209-0465" &
Chr(10) & _
"&D"
strCenterFooter = "Ad-Tech International, Inc." & Chr(10) & _
"www.adtechintl.com"

' Formetco
Case .OptionButtons("optFormetco").Value

strLogoFileName = "\\cdc.gov\private\M131\iqz9\Ad
Tech\Temporary\Formetco Logo.jpg"

strRightHeader = "&""-,Bold""QUOTATION / SALES AGREEMENT" &
Chr(10) & _
"&""-,Regular""Formetco" & Chr(10) & _
"2963 Pleasant Hill Road" & Chr(10) & _
"Duluth, GA 30096" & Chr(10) & _
"PH 1-800-Formetco, Fax ???-???-????" &
Chr(10) & _
"&D"
strCenterFooter = "Formetco" & Chr(10) & _
"www.formetco.com"
End Select

' change header/footer properties
With .PageSetup

' remove old header
.LeftHeader = ""

' change logo
.LeftHeaderPicture.Filename = strLogoFileName

' ensure header picture can be visible
.LeftHeader = "&G"

' change header/footer
.RightHeader = strRightHeader
.CenterFooter = strCenterFooter
End With
End With

Application.ScreenUpdating = True

End Sub
--
Cheers,
Ryan
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Headers and Footer to an Entire Workbook?? Spyder Excel Discussion (Misc queries) 5 February 25th 10 03:46 PM
saving a sheet as a web page and retaining the headers and footer. Susan Excel Discussion (Misc queries) 1 October 27th 06 04:29 PM
Headers and Footer on the Chart do not work?????? maperalia Charts and Charting in Excel 1 March 20th 06 05:01 PM
How do I make the custom headers and footer repeat on every works. Chrisod Excel Worksheet Functions 3 January 24th 05 09:05 AM
spesific fonts for headers&footer is Excel J_J Excel Programming 3 October 16th 04 08:05 AM


All times are GMT +1. The time now is 03:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"