Set footer to sheet name and make it red througout the workbook

  • So I'm trying to change footers on all sheets in my workbook, set them to sheet name and make the font red. But, here's the catch: I don't need the whole name of the worksheet, just the part of it before space (" "). So, if the worksheet is named "1. Something" I just need the "1." part.


    The code I've got so far is below:




    So far I can either make random text red:

    Code
    WS.PageSetup.LeftFooter = "&KFF0000Text"


    OR I can set the footer to be the value of str variable:

    Code
    'WS.PageSetup.LeftFooter = "&KFF0000&str"



    Tried a coupe things, but cant make BOTH of those to work in conjunction. If anyone can help me that would be greatly appreciated!

  • Re: Set footer to sheet name and make it red througout the workbook


    This works:

    Code
    WS.PageSetup.LeftFooter = "&KFF0000 " & str


    Dan

    [SIZE=1]It's like asking a mechanic to fix your car, without actually taking your car to him. Post your code/file and you'll get much quicker and more accurate solutions to your problem.[/SIZE]

  • Re: Set footer to sheet name and make it red througout the workbook


    Dan, thanks so much! Works like a charm.


    Quote from danerida;724467

    This works:

    Code
    WS.PageSetup.LeftFooter = "&KFF0000 " & str


    Dan

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!