Headers based on Cell Values

I would like to have my header variable based upon the value of certai
cells. 
If there is a way to do this without VBA, that would be the best way
However, if it is only in VBA, then that is what I will have to do

--
kralj
-----------------------------------------------------------------------
kraljb's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=995
View this thread: http://www.excelforum.com/showthread.php?threadid=27791

0
11/12/2004 11:35:20 PM
excel.misc 78881 articles. 5 followers. Follow

1 Replies
464 Views

Similar Articles

[PageSpeed] 50

Hi
not possible without VBA. You have to use the BeforePrint event of your
workbook. So try putting the following type of code in your workbook
module 'ThisWorkbook' (don't put it in a standard module):
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
   For Each wkSht In Me.Worksheets
     With wkSht.PageSetup
         .CenterHeader = wkSht.range("A1").value
      End With
   Next wkSht
End Sub



This code inserts the value of cell A1 in each worksheet's center
header

--
Regards
Frank Kabel
Frankfurt, Germany

"kraljb" <kraljb.1fmtgm@excelforum-nospam.com> schrieb im Newsbeitrag
news:kraljb.1fmtgm@excelforum-nospam.com...
>
> I would like to have my header variable based upon the value of
certain
> cells.
> If there is a way to do this without VBA, that would be the best way.
> However, if it is only in VBA, then that is what I will have to do.
>
>
> --
> kraljb
> ---------------------------------------------------------------------
---
> kraljb's Profile:
http://www.excelforum.com/member.php?action=getinfo&userid=9955
> View this thread:
http://www.excelforum.com/showthread.php?threadid=277910
>

0
frank.kabel (11126)
11/13/2004 7:16:45 AM
Reply:

Similar Artilces:

How can I delete rows programmatically based on certain criteria?
I have a large dataset in Microsoft Excel 2003 with almost 3000 lines and I want to delete the rows of it, which have nulls in one or more of their columns. e.g. A B C D 1 2 3 4 1 4 5 2 3 4 Result : The 2nd and 3rd rows will be deleted or someway discarded. How can I do this programmatically? One way: Public Sub DeleteLinesWithNulls() Const nCOLS As Long = 4 Dim rDelete As Range Dim rCell As Range For Each rCell In Range("A1:A" & _ Range("A" & Rows.Count).End(xlUp).Row) If Application.CountA(rCell.Resize...

Header of ListView
Hi, I have a Listview control with some items within. This ListView has 3 column A,B and C. A item's are left-aligned. B and C ones are right-aligned. this, only for items... but for header i would like to have a different alignment than their respective items. for example : A, B and C header will be left-aligned so graphically it should be like that : A | B | C | -------------------------------------- Item A1 Item B1 Item C1 Item A2 Item B2 Item C2 .... So how an i do it ? Because when i modify HDITEM structure it's for the full c...

HELP!! Header thats not a header
Hello All, I have a spreadsheet that when printed is 7 pages. I put a header that is from cells 1 to 6 and have set it in the page setup in the section sheets-print title - rows to repeat at top cells 1-6. This works perfect, every sheet when printed displays these rows at the top of the page. The problem is I don`t want this to print on the top of page 7. How can I make it so pages 1-6 the rows repeat on top and page 7 it doesn`t. Any help would be greatly appreciated. Thanks, Kevin M You have to print in 2 batches, first the 1-6 pages, then remove this and print the 7th page...

Date and text in a cell
I am trying to figure how to put current date +1 and text in a cell W use this to copy and paste a comment that we make on MANY tickets day. For example, lets say the cell is this Your monitor will arrive on 9/2 I want to be able to say Your Monitor will arrive on =now()+1 ----------- So that I don't have to change the day on that cell everyday to th next day. Thank -- Message posted from http://www.ExcelForum.com ="Your monitor will arrive on: " & text(today()+1,"mm/dd/yyyy") is one way. "fourlugas <" wrote: > > I am trying to figur...

adding figures in adjacent cells next to specified numbers
I have two columns. One with single digits (0-9), the other has number but also contains x's plus blank spaces. Each time the number 3 appears in column 1 i'd like to add the value o the corresponding figure in column 2 and get a total at the end. Is it also possible to do this and set numerical limits. For example each time 3 appears in column 1, add column 2 figure if it fall between 4 and 9? Thanks in advanc -- Message posted from http://www.ExcelForum.com One way: =SUMPRODUCT(--(A1:A1000>=4),--(A1:A1000<=9),B1:B1000) In article <judoist.17usjg@excelforum-nospa...

Cell references
If someone could help me, I would really appreciate it! I am using the LARGE function to return certain values from a list of numbers. For example, I have the following data: JAN 100 FEB 150 MAR 200 APR 175 MAY 180 In part of a spreadsheet, I have LARGE(($B$10:$B$14),1) which returns the highest value, 200. What I am trying to do next is have data from the corresponding row be returned. For example, I want MAR returned in the cell next to the LARGE formula above. I tried to do this by turning on the R1C1 function, and inserting the formula into the reference, but it is taking t...

Populating a Cell based on a Range of Values (Part II)
Sorry, but my I'm still not sure how to make my formula evaluate a full range of values. For example, the cell I need to populate will have values based on what is calculated in another cell as follows: If value in cell A1 is 1.0 and > 0 in new cell .900 - .999 1 in new cell .800 - .899 2 in new cell all the way down to <.100 which should put a 10 in the new cell. Thanks again for all the help! It is definitely a learning experience for me. Ken -- akkrug Part of the formula is working: =IF(AND(A1>=0.8,A1<=0.899),...

Header
I am new to this Excel 2007 and don't know how to put a title where the lettered columns are. I need it to be centered across 4 columns. Thanks for the help Example 1. Put the word TITLE in cell 1. 2. Highlight cells A 1 to D 1 inclusive (your 4 columns). 3. On the Home tab in the Alignment group click on the Merge and Center button. The word TITLE will now be centred acros the said 4 columns. If my comment have helped please hit Yes. Thanks. "Belin" wrote: > I am new to this Excel 2007 and don't know how to put a title where the...

About HWND of the dialog in the CDiloag based class
Respected Jeff Partch, Thanks for your advise. It is true that I can access the handle of the dialog box using m_hWnd. But my problem is that I want to call a function with the following syntax in my program : LRESULT CALLBACK MainDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) The second parameter is the ID of the button like controls, which have been pressed. If I call this function which inherits CWinApp, with this function declared in this file passing handle as an argument, how do I get this second parameter? If I write the same program in Win32, the problem i...

Report header below page header
I want a report heading on the first page - but I would like it to be below the page header (so that my page header is identically positioned on all pages). Alternatively I want a part of my page header only displayed on the first page. How can this be made? -- Diane I expect you could create a new Group Header section on a constant like: =1 Display the header for this group. It will display only once and will be positioned below the first Page Header section. -- Duane Hookom Microsoft Access MVP "DianePDavies" wrote: > I want a report headin...

Assing a value to a cell conditional on another.
I'm trying to assign a value to a cell conditionally dependant o another cells value. Something like... =IF(K21=55,P21=27) I get "FALSE" as the result. Can anyone help me with the flaw in m formula -- Message posted from http://www.ExcelForum.com I'm assuming this formula is in P21. If so, it should read =IF(K21=55, 27,) "guilbj2 >" wrote: > I'm trying to assign a value to a cell conditionally dependant on > another cells value. Something like... > > =IF(K21=55,P21=27) > > I get "FALSE" as the result. Can anyone help...

How do I change headers for all worksheets in a workbook?
.... without having to change the header on each worksheet individually. Try selecting all sheets and then changing the headers, all shoul change at the same time Pau -- Paul Sheppar ----------------------------------------------------------------------- Paul Sheppard's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2478 View this thread: http://www.excelforum.com/showthread.php?threadid=39467 Frank, I think you're referring to the custom header, in File - Page Setup. If all the page setup parameters (margins, rows to repeat, etc.) are to be the same...

Header is covered up
I imported a word document into Pub 2003. I let Publisher create the textboxes. This is a large patient handbook that we want to put into Publisher. Lots of the textboxes cover up the Header and some do not. Does this mean I will have to resize every textbox or is there another way? Is the header from Word too? Publisher does not support headers. If you are importing from Word you have no control on how Publisher places the text. If you copy/paste you can set your margin to below the Header. You will have to design the header in Publisher manually. Create your first text box, pas...

Date in Headers and Footers
In Excel Office XP, how can I change the default date in a header and footer? The "&[Date]" command defaults to mm/dd/yyyy. I would like something else. Hi AFAIK this would require VBA. Would this be a feasible way for you? >-----Original Message----- >In Excel Office XP, how can I change the default date in >a header and footer? The "&[Date]" command defaults to >mm/dd/yyyy. I would like something else. >. > Thanks for your help, Frank, but since it take the Virtual Basketball Association ( :) ), I'll pass. If Microsoft isn...

transpose 3d cells to a column in single workbook
I would like to extract 3d cells from a set of worksheets into a single column on another worksheet within the same workbook. How can I do this? Insert a worksheet named Summary, then select the 3D range, and run the macro below. HTH, Bernie MS Excel MVP Sub TryNow() Dim mySht As Worksheet Dim dataSht As Worksheet Dim myRange As Range Dim myCell As Range Set dataSht = Worksheets("Summary") Set myRange = Selection For Each mySht In ActiveWindow.SelectedSheets For Each myCell In mySht.Range(myRange.Address) dataSht.Range("A65536").End(xlUp)(2).Value = _ myCell.Value N...

How do I validate data using different lists based on the data in.
How do I validate data using different lists based on the data in another cell? There are instructions here for dependent data validation lists: http://www.contextures.com/xlDataVal02.html Shannon wrote: > How do I validate data using different lists based on the data in another cell? -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html ...

Lookup Values, etracting Row header and column header.
Hi all, I have a dat matrix having 100 rows and 100 columns. The data is dynamic and keeps changing. 3500 3550 3600 3650 3700 3550 - - - - 3600 - - - - 3650 - - - - 3700 - - - - 3750 - - - - 3800 - 20 - - 3850 - - - - 3900 - - - 15 For eg: the data in row 3800 and column 3600 shows a value of 20. Is there any function by which i can extract any positive values in the data matrix such that it gives a summary in another worksheet: # Row Column Value 1 3800 3600 20 2 3900 3700 15 Note: th...

PO will not close
I have a PO that I cannot close. It appears that in the POP10300 table the receipt transaction header is corrupted. Several of the columns are empty, but the line detail is there in the POP10310 table. I think because the line detail is there the GP will not allow me to close or cancel the PO. I have run checklinks against it as well as the purchasing reconcile and it doesn't seem to clean up. Any suggestions? JR, But, have you posted the receipt? If not, why don't you remove the receipt, re-enter, and post? After doing this, you should be able to close the PO. Best regar...

Filtering on Header content
Hello, I'm interested in knowing if Outlook Express & Outlook 2002 can filter received messages based upon "Header content". Example: X-Is-Spam-Level:***** I was able to setup the rule with Outlook 2002, although it hasn't worked for me(does it only work for specific modes). I haven't been able to determine where to add the filter rules for the "Header content" with Outlook Express. With Eudora only the "Sponsored or Paid" mode offer the ability to filter received messages based upon content of message "Header information". Thanks ev...

Mark Cells for input data
I want to know if there is a way to mark the cells that the user need t input data, color it but I don't want to print that cells with color -- Message posted from http://www.ExcelForum.com Hi 1) Fill the cells you want to mark with the colour you want if you have not already done so. 2) Select "File>Page Setup" and then select the "Sheet" tab. 3) Place a check mark in the box "Black and White". This setting will print the entire sheet in black and white. -- XL2002 Regards William willwest22@yahoo.com "elliot315 >" <<elliot315.1...

Drop-down arrow only visible when cell selected
Hi all, I created several drop-down lists using Data, Validate,... The drop-down arrows are not visible unless the cells are selected. Is this the default and can it be changed or am I stuck with the "invisible" drop-downs? I would like to have all the drop-down arrows visible at all times so it will be obvious to a user that they will be using drop-downs. I was also wondering if a drop-down can be disabled ("grayed out") as a result of a conditional test? Thanks John Hi! You can use a combobox from the Forms toolbar. The arrow is always visible. For your ...

How do I prevent duplicate numbers in a range of validated cells?
I have a validation rule for a series of cells. The 3 cells are only allowed to have a value of 3, 5, or 1. I want to fix it so that each number may only be used once in a range of 3 cells. .... So in A1:A3, each number may only appear once or an error message pops up or the cell starts blinking ~ something needs to happen to notify the user that there is an error that needs correcting. THanks ...

My report header shows in design view but not print preview
I have a report header in a report that prompts for info and omits some information in the detail section if the data is zero or null. While the report header shows up in the design view; it doesn't show in the print preview mode. Any suggestions? -- Thanks, Karen "Karen" <Karen@discussions.microsoft.com> wrote in message news:991881A0-921F-47A7-B1B2-6B180111081B@microsoft.com... >I have a report header in a report that prompts for info and omits some > information in the detail section if the data is zero or null. > > While the report header shows up i...

How can I assign a data for one cell from another fixed cell?
I can assign data to one cell by put formular, for example: =H5. But if I add a row, my cell will get data from H6, Excel automatically modified my formular to: =H6 And now I want the data always come from =H5, no matter how many rows I add on top of it. PLease help me. I remember somebody did it, but I forget it. Thank you very much! If I understand your question correctly, you would use absolute references ($ signs to fix the row, column or both)... =$H$5 Rick "new Excel user" <new Excel user@discussions.microsoft.com> wrote in message news:BCAE5E50-1EAF-4ADA-9F24...

Grey Header Line
I have received an email in Outlook 2002 that the font is a light grey in color in the header. I'm sure it indicates something - I just can't find the explanation anywhere. The curiosity level is high. Thanks in advance, MoonDogii Could it be an expired email item? "MoonDogii" <bmohney@REMOVECAPSclayburngroup.com> wrote in message news:unwuB7kWGHA.5012@TK2MSFTNGP05.phx.gbl... >I have received an email in Outlook 2002 that the font is a light grey in >color in the header. I'm sure it indicates something - I just can't find >the explanation ...