Custom header Excel help - HotUKDeals
We use cookie files to improve site functionality and personalisation. By continuing to use HotUKDeals, you accept our cookie and privacy policy.
Get the HotUKDeals app free at Google Play

Search Error

An error occurred when searching, please try again!

Login / Sign UpSubmit

Custom header Excel help

£0.00 @
I'm using =TODAY()-(INT(RAND()*3)+1) in an Excel cell. What I want to be able to do is have that cell content to appear in the left section of custom header rather than &[Date]. Is it possible… Read More
OllieSt Avatar
2w, 1d agoPosted 2 weeks, 1 day ago
I'm using

=TODAY()-(INT(RAND()*3)+1) in an Excel cell.

What I want to be able to do is have that cell content to appear in the left section of custom header rather than &[Date]. Is it possible, because I can't get it to work.
OllieSt Avatar
2w, 1d agoPosted 2 weeks, 1 day ago
Options
Best Answer
OllieSt
The formula chooses a random date up to 3 days prior to today. I want that SAME random date to appear in the header. So it's cell value and it does seem to be a macro I need. I've never created a macro for this kind of thing. Can I create it so it automatically runs when I choose to print?

Yep.

Afaik, you can't trigger a macro to run by printing a doc, but you can trigger a printjob as part of a macro, so you'd basically need a macro which does the following things

1) Copy from cell where you have rand date value
2) Paste to cell as values
3) Print

Iirc, you can do this in seconds by using the Record Macro function. You may have to manually write the Print function, but that shouldn't take you long. Use Google to help you find the specifics on how to do these things with your version of Excel.

Edited By: dxx on Jul 11, 2017 16:33

All Responses

(4) Jump to unreadPost an answer
Responses/page:
#1
I'm not clear on what you mean by cell content.


If you want to see the formula, completely clear the cell, format it as text, and paste the formula in. Alternatively, as a handy shortcut, insert a space before the =.

If you want to see the number, format the cell as a number.

If you're trying to copy the cell value, afaik there's no way to do that with formatting or formula, and you'll need to set up a quick macro to copy/paste as values, and then set your header to be ="Header blah "&=D11, where D11 is where the values-only pasting of your cell is placed.
#2
The formula chooses a random date up to 3 days prior to today. I want that SAME random date to appear in the header. So it's cell value and it does seem to be a macro I need. I've never created a macro for this kind of thing. Can I create it so it automatically runs when I choose to print?
#3
random number generator needs to be refreshed to produce a new random number so you will need a macro to recalculate every time you print i believe.
#4
OllieSt
The formula chooses a random date up to 3 days prior to today. I want that SAME random date to appear in the header. So it's cell value and it does seem to be a macro I need. I've never created a macro for this kind of thing. Can I create it so it automatically runs when I choose to print?

Yep.

Afaik, you can't trigger a macro to run by printing a doc, but you can trigger a printjob as part of a macro, so you'd basically need a macro which does the following things

1) Copy from cell where you have rand date value
2) Paste to cell as values
3) Print

Iirc, you can do this in seconds by using the Record Macro function. You may have to manually write the Print function, but that shouldn't take you long. Use Google to help you find the specifics on how to do these things with your version of Excel.

Edited By: dxx on Jul 11, 2017 16:33

Post an Answer

You don't need an account to leave a response. Just enter your email address. We'll keep it private.

...OR log in with your social account

...OR comment using your social account

Thanks for your comment! Keep it up!
We just need to have a quick look and it will be live soon.
The community is happy to hear your opinion! Keep contributing!