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:
Code
Private Sub Footer()
Dim WS As Worksheet
Dim str As String
For Each WS In Worksheets
str = Left(WS.Name, WorksheetFunction.Find(" ", WS.Name, 1) - 2)
WS.PageSetup.LeftFooter = "&KFF0000Text"
'WS.PageSetup.LeftFooter = "&KFF0000&str"
Next WS
End Sub
Display More
So far I can either make random text red:
OR I can set the footer to be the value of str variable:
Tried a coupe things, but cant make BOTH of those to work in conjunction. If anyone can help me that would be greatly appreciated!