Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default Spellcheck in Headers and Footers

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Spellcheck in Headers and Footers

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default Spellcheck in Headers and Footers

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Spellcheck in Headers and Footers

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default Spellcheck in Headers and Footers

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Spellcheck in Headers and Footers

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Headers and Footers metaltecks Excel Discussion (Misc queries) 3 February 15th 07 08:27 PM
Headers and Footers in VBA JacMar Excel Discussion (Misc queries) 4 January 28th 07 07:37 PM
Headers and Footers bo Excel Discussion (Misc queries) 1 September 29th 06 07:56 PM
headers/footers Sadie Excel Discussion (Misc queries) 1 September 21st 05 04:12 PM
Headers & Footers Dee Excel Discussion (Misc queries) 2 July 8th 05 02:23 PM


All times are GMT +1. The time now is 01:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"