PDA

View Full Version : Page Header: Loop based on values in a range



acsishere
06-27-2008, 12:50 PM
Dear Friends,

I have a named range "Subcode" in my workbook (Sheet name Listsheet).
CODE / SUBJECT
000 / GENERALITIES
100 / PHILOSOPHY
200 / RELIGION
300 / SOCIAL SCIENCES
400 / LANGUAGES
500 / PURE SCIENCES
600 / APPLIED SCIENCES

I have 8000 data in (sheet name) "DATASHEET".
In ColA:
A3:A50 the values are "000". No other value is there.
A51:A100 the values are "100".
A101:A151 the values are "200". (means these are of a group, and ranges are having unique values only).

In ColB:ColAZ other related data is there.

I need a macro to do the following:

When I am to print a page of Groupcode 600, the macro should pick-up the value & it's Subject to show (like: 600: APPLIED SCIENCES) in the Header page of that particular page.

If I am to print all pages, then in every page the macro should show the value in loop (i.e. if ColA of printing page is "000" then the Header should show "000: GENERALITIES"; then, if ColA of printing page is "100" then the Header should show "100: PHILOSOPHY").

i.e. the header should Lookup the value from the Subcode range with ColA of Datasheet.

Any possibility? Your kind help is highly appreciated.

Thanks in advance.

acsishere.

lucas
06-27-2008, 01:13 PM
Hi, I'm leaving on a vacation soon so I just have a minute. I didn't work out the custom headers but the attached will give you some idea of how to do the filter and print.

acsishere
06-27-2008, 01:27 PM
It's working partially. That too it shows the preview of all pages.

Besides, I am very much in need of the PageHeader should appear in Loop as per the value in ColA of DATASHEET.

Can you please give me a solution?

Thanks in advance,

acsishere.

lucas
06-27-2008, 02:24 PM
Look in the code for how to make it actually print instead of just preview. You have to try to do some of the work yourself. A full solution will depend on how much effort you put into it.

acsishere
06-28-2008, 12:05 PM
Thanks for your encouraging reply.

I trying to get the result done. Meanwhile, I am very much in need of looping the Page Header based on a range (as I explained in my first post).

Can you please help me to find out a solution?

Please Sir,

Thanks in advance.

acsishere.

lucas
06-28-2008, 09:03 PM
This change will show you how to make the series number...the 000, 100, etc. be the centerheader on each printout.....see if you can figure out how to add the offset cell. Clue you will need to use the & ampersand to combine the series number with the offset cell value.