Webtramp
05-09-2007, 08:33 AM
I have a strange problem.
I?m trying to create a header. The function is triggered on the beforeprint event.
It is supposed to write the follwowing Text "Monatsbericht f?r CC F&B".
I know that I have to put two &s to get one to be displayed.
However if the line of code executes then I can find "Monatsbericht f?r CC F&F" in the header.
I recorded a macro to see what Excel does if I manually enter "Monatsbericht f?r CC F&B".
This is the result: .LeftHeader = "&""MS Sans Serif,Fett""Monatsbericht f?r CC F&&A" :wot
It puts an A.:doh:
If I do the recording procedure but enter "Monatsbericht f?r CC F&A" Excel records: .LeftHeader = "&""MS Sans Serif,Fett""Monatsbericht f?r CC F&&N"
Can someone explain this behaviour to me? :think:
As this code is transferred to many different worksheets where the Header will be created dynamically out of the filename I can not just hardcode the odd solution that Excel gives me.
I would be grateful for any help.
I?m trying to create a header. The function is triggered on the beforeprint event.
It is supposed to write the follwowing Text "Monatsbericht f?r CC F&B".
I know that I have to put two &s to get one to be displayed.
However if the line of code executes then I can find "Monatsbericht f?r CC F&F" in the header.
I recorded a macro to see what Excel does if I manually enter "Monatsbericht f?r CC F&B".
This is the result: .LeftHeader = "&""MS Sans Serif,Fett""Monatsbericht f?r CC F&&A" :wot
It puts an A.:doh:
If I do the recording procedure but enter "Monatsbericht f?r CC F&A" Excel records: .LeftHeader = "&""MS Sans Serif,Fett""Monatsbericht f?r CC F&&N"
Can someone explain this behaviour to me? :think:
As this code is transferred to many different worksheets where the Header will be created dynamically out of the filename I can not just hardcode the odd solution that Excel gives me.
I would be grateful for any help.