Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
How do you spellcheck a custom header/footer in 2003? Is it the same in 2007?
Thanks in advance for your help -- Thanks, Allison |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You cannot spellcheck a header or footer in any version AFAIK.
You could use VBA to set a cell value as a header or footer. Sub CellInFooter() With ActiveSheet .PageSetup.CenterFooter = .Range("A1").Value End With End Sub Run spellcheck on the referenced cell after user enters a value. Gord Dibben MS Excel MVP On Sat, 15 Sep 2007 07:08:01 -0700, Allison wrote: How do you spellcheck a custom header/footer in 2003? Is it the same in 2007? Thanks in advance for your help |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks! I appreciate the response. Allison
-- Thanks, Allison "Gord Dibben" wrote: You cannot spellcheck a header or footer in any version AFAIK. You could use VBA to set a cell value as a header or footer. Sub CellInFooter() With ActiveSheet .PageSetup.CenterFooter = .Range("A1").Value End With End Sub Run spellcheck on the referenced cell after user enters a value. Gord Dibben MS Excel MVP On Sat, 15 Sep 2007 07:08:01 -0700, Allison wrote: How do you spellcheck a custom header/footer in 2003? Is it the same in 2007? Thanks in advance for your help |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You can spell check individual words in a macro, though.
This assumes that you have individual words separated by spaces: Option Explicit Sub testme() Dim myHeaderStrings As Variant Dim myHeaders As Variant Dim hCtr As Long With Worksheets("sheet1").PageSetup Call CheckSpellingOfWord(.LeftHeader) Call CheckSpellingOfWord(.CenterHeader) Call CheckSpellingOfWord(.RightHeader) Call CheckSpellingOfWord(.LeftFooter) Call CheckSpellingOfWord(.CenterFooter) Call CheckSpellingOfWord(.RightFooter) End With End Sub Sub CheckSpellingOfWord(myHeader As String) Dim myHeaderStrings As Variant Dim hCtr As Long Dim WordIsOk As Boolean myHeader = Application.Trim(myHeader) If myHeader = "" Then 'nothing in this section Else myHeaderStrings = Split(myHeader) For hCtr = LBound(myHeaderStrings) To UBound(myHeaderStrings) WordIsOk = Application.CheckSpelling(word:=myHeaderStrings(hC tr)) If WordIsOk Then 'skip it Else MsgBox "Header/Footer has an error" _ & vbLf & myHeaderStrings(hCtr) End If Next hCtr End If End Sub I didn't test it in xl2007, though. Allison wrote: How do you spellcheck a custom header/footer in 2003? Is it the same in 2007? Thanks in advance for your help -- Thanks, Allison -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Wow! I am always amazed at how much more there always is to learn.
I wonder if for most users it would be easier to set up a template with the first 4 rows set as print titles for a header with data that they type, for example, so that spell check would work. Then the footer could include just field codes (dates, path names, page numbers), etc. Your thoughts? -- Thanks, Allison "Dave Peterson" wrote: You can spell check individual words in a macro, though. This assumes that you have individual words separated by spaces: Option Explicit Sub testme() Dim myHeaderStrings As Variant Dim myHeaders As Variant Dim hCtr As Long With Worksheets("sheet1").PageSetup Call CheckSpellingOfWord(.LeftHeader) Call CheckSpellingOfWord(.CenterHeader) Call CheckSpellingOfWord(.RightHeader) Call CheckSpellingOfWord(.LeftFooter) Call CheckSpellingOfWord(.CenterFooter) Call CheckSpellingOfWord(.RightFooter) End With End Sub Sub CheckSpellingOfWord(myHeader As String) Dim myHeaderStrings As Variant Dim hCtr As Long Dim WordIsOk As Boolean myHeader = Application.Trim(myHeader) If myHeader = "" Then 'nothing in this section Else myHeaderStrings = Split(myHeader) For hCtr = LBound(myHeaderStrings) To UBound(myHeaderStrings) WordIsOk = Application.CheckSpelling(word:=myHeaderStrings(hC tr)) If WordIsOk Then 'skip it Else MsgBox "Header/Footer has an error" _ & vbLf & myHeaderStrings(hCtr) End If Next hCtr End If End Sub I didn't test it in xl2007, though. Allison wrote: How do you spellcheck a custom header/footer in 2003? Is it the same in 2007? Thanks in advance for your help -- Thanks, Allison -- Dave Peterson |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Do you mean you're going to create a header with 4 different headers--and the
users can delete the 3 lines that they don't need? If that's what you mean, then the header/footer dialog isn't very nice to work with and each has a limit on the amount of text you can put in each section. If you meant that you're going to put as much info as you need in the headers and let the users only change the footers, I like that much better. As a user, anything you (as a developer) can do to make it easier is better for me <vbg. Allison wrote: Wow! I am always amazed at how much more there always is to learn. I wonder if for most users it would be easier to set up a template with the first 4 rows set as print titles for a header with data that they type, for example, so that spell check would work. Then the footer could include just field codes (dates, path names, page numbers), etc. Your thoughts? -- Thanks, Allison "Dave Peterson" wrote: You can spell check individual words in a macro, though. This assumes that you have individual words separated by spaces: Option Explicit Sub testme() Dim myHeaderStrings As Variant Dim myHeaders As Variant Dim hCtr As Long With Worksheets("sheet1").PageSetup Call CheckSpellingOfWord(.LeftHeader) Call CheckSpellingOfWord(.CenterHeader) Call CheckSpellingOfWord(.RightHeader) Call CheckSpellingOfWord(.LeftFooter) Call CheckSpellingOfWord(.CenterFooter) Call CheckSpellingOfWord(.RightFooter) End With End Sub Sub CheckSpellingOfWord(myHeader As String) Dim myHeaderStrings As Variant Dim hCtr As Long Dim WordIsOk As Boolean myHeader = Application.Trim(myHeader) If myHeader = "" Then 'nothing in this section Else myHeaderStrings = Split(myHeader) For hCtr = LBound(myHeaderStrings) To UBound(myHeaderStrings) WordIsOk = Application.CheckSpelling(word:=myHeaderStrings(hC tr)) If WordIsOk Then 'skip it Else MsgBox "Header/Footer has an error" _ & vbLf & myHeaderStrings(hCtr) End If Next hCtr End If End Sub I didn't test it in xl2007, though. Allison wrote: How do you spellcheck a custom header/footer in 2003? Is it the same in 2007? Thanks in advance for your help -- Thanks, Allison -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Headers and Footers | Excel Discussion (Misc queries) | |||
Headers and Footers in VBA | Excel Discussion (Misc queries) | |||
Headers and Footers | Excel Discussion (Misc queries) | |||
headers/footers | Excel Discussion (Misc queries) | |||
Headers & Footers | Excel Discussion (Misc queries) |