Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
bozrdang
 
Posts: n/a
Default Can you put a formula in a header?


Title pretty much says it all. I simply want to be able to have the
contents of a cell entered as text in my header. For example I want my
header to read "Part #1234". In cell D6 the actual part number "1234"
is entered. Can I do this somehow?


--
bozrdang
------------------------------------------------------------------------
bozrdang's Profile: http://www.excelforum.com/member.php...o&userid=34463
View this thread: http://www.excelforum.com/showthread...hreadid=542243

  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave O
 
Posts: n/a
Default Can you put a formula in a header?

Do you mean a column header on a sprdsht? If yes a formula will do it:
using your example,
="Part #"&D6

  #3   Report Post  
Posted to microsoft.public.excel.misc
bozrdang
 
Posts: n/a
Default Can you put a formula in a header?


No, I mean a page header.


--
bozrdang
------------------------------------------------------------------------
bozrdang's Profile: http://www.excelforum.com/member.php...o&userid=34463
View this thread: http://www.excelforum.com/showthread...hreadid=542243

  #4   Report Post  
Posted to microsoft.public.excel.misc
Dave O
 
Posts: n/a
Default Can you put a formula in a header?

Everything I've read by searching this newsgroup
http://groups.google.com/group/micro...353db9c73db179
....suggests this can only be done with VBA. This link gives an example.

  #5   Report Post  
Posted to microsoft.public.excel.misc
Miguel Zapico
 
Posts: n/a
Default Can you put a formula in a header?

You may use the workbook event "Before_print". This basic macro will
substitute whatever you have in the center header with the values of the
range A1 on the active sheet:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.CenterHeader = Range("A1").Value
End Sub

You can make it as complicate as you want, the event takes place even before
the print preview, so you can see the results before printing.

Hope this helps,
Miguel.

"bozrdang" wrote:


No, I mean a page header.


--
bozrdang
------------------------------------------------------------------------
bozrdang's Profile: http://www.excelforum.com/member.php...o&userid=34463
View this thread: http://www.excelforum.com/showthread...hreadid=542243




  #6   Report Post  
Posted to microsoft.public.excel.misc
bozrdang
 
Posts: n/a
Default Can you put a formula in a header?


Thanks guys! That does exactly what I asked, my only problem is that
Since it's a header I need it to be a larger font size and bold. Not
to mention that it was meant to be the 2nd line in 3 lines of text in
the Header. Some brief searching seems to indicate you can't format
text in VBA. My ultimate goal was something like this:

* C o m p a n y N a m e *
PART # 1234 WORK INSTRUCTIONS
::Page 1 of 2::


LOL, I must be a high maintenance Office user becasue I dabble a little
bit in both Excel and Access and I invariably end up wanting to do
something that seems relatively simple, but ends up being extremely
difficult to achieve.


--
bozrdang
------------------------------------------------------------------------
bozrdang's Profile: http://www.excelforum.com/member.php...o&userid=34463
View this thread: http://www.excelforum.com/showthread...hreadid=542243

  #7   Report Post  
Posted to microsoft.public.excel.misc
Miguel Zapico
 
Posts: n/a
Default Can you put a formula in a header?

Well, VBA may be able to do what you need. The best way of finding out is
recording a macro while you do all the formating that you want to do, and
then look at the code that has been generated. In the line that sets the
CenterHeader you may find the code you are looking for.

Miguel.

"bozrdang" wrote:


Thanks guys! That does exactly what I asked, my only problem is that
Since it's a header I need it to be a larger font size and bold. Not
to mention that it was meant to be the 2nd line in 3 lines of text in
the Header. Some brief searching seems to indicate you can't format
text in VBA. My ultimate goal was something like this:

* C o m p a n y N a m e *
PART # 1234 WORK INSTRUCTIONS
::Page 1 of 2::


LOL, I must be a high maintenance Office user becasue I dabble a little
bit in both Excel and Access and I invariably end up wanting to do
something that seems relatively simple, but ends up being extremely
difficult to achieve.


--
bozrdang
------------------------------------------------------------------------
bozrdang's Profile: http://www.excelforum.com/member.php...o&userid=34463
View this thread: http://www.excelforum.com/showthread...hreadid=542243


  #8   Report Post  
Posted to microsoft.public.excel.misc
bozrdang
 
Posts: n/a
Default Can you put a formula in a header?


Thanks a ton Miguel! I managed to get it to do exactly what I wanted
doing that. I've never played with macros before and I've only played
with VBA in Access so I didn't know you could do that. It's kinda like
building a query in QBE in Access and then looking at the SQL code it
creates. Very handy.

I guess some posts I read elsewhere were incorrect about formatting
text through VBA. At least in a header anyway.

Thanks again Miguel and Dave!


--
bozrdang
------------------------------------------------------------------------
bozrdang's Profile: http://www.excelforum.com/member.php...o&userid=34463
View this thread: http://www.excelforum.com/showthread...hreadid=542243

  #9   Report Post  
Posted to microsoft.public.excel.misc
Miguel Zapico
 
Posts: n/a
Default Can you put a formula in a header?

That's a good way of saying it, I have also used QBE to take a look at the
SQL after :)

I'm glad that it helped,
Miguel.

"bozrdang" wrote:


Thanks a ton Miguel! I managed to get it to do exactly what I wanted
doing that. I've never played with macros before and I've only played
with VBA in Access so I didn't know you could do that. It's kinda like
building a query in QBE in Access and then looking at the SQL code it
creates. Very handy.

I guess some posts I read elsewhere were incorrect about formatting
text through VBA. At least in a header anyway.

Thanks again Miguel and Dave!


--
bozrdang
------------------------------------------------------------------------
bozrdang's Profile: http://www.excelforum.com/member.php...o&userid=34463
View this thread: http://www.excelforum.com/showthread...hreadid=542243


Reply
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
Is it possible? DakotaNJ Excel Worksheet Functions 25 September 18th 06 09:30 PM
assign formula to another cell Dannycol Excel Worksheet Functions 3 May 12th 06 09:46 PM
How do I pull the column header next to a Max formula? mconway Excel Worksheet Functions 2 May 10th 06 05:08 AM
Display result of formula in header? Hubitron2000 Excel Discussion (Misc queries) 2 March 24th 06 07:25 PM
"Unable to set the Formula property of the Series class" with a tw PeterQ Charts and Charting in Excel 1 February 15th 06 07:37 PM


All times are GMT +1. The time now is 09:39 AM.

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"