ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   spell check ranges in a do loop (https://www.excelbanter.com/excel-programming/383822-spell-check-ranges-do-loop.html)

Daveh

spell check ranges in a do loop
 
I have a macro trying to spell check a number of discrete ranges ( not the
whole spread sheet). The range names are passed to the spell check sub
routine which uses the following lines of code

Application.Goto Reference:=Range(Address), scroll:=True
Application.union((activesheet.Range(Address)),
Activesheet.Range("A1").Checkspelling AlwaysSuggest:=True, SpellLang:=2057

The problem I have is that if there are 3 ranges (for example) I want to
spell check, it works fine for the first range, but doesn't work for the
later ranges.

I have checked the formatting of the cell ranges in the spreadsheet and thy
are all the same.

Thanks !

Daveh

Tom Ogilvy

spell check ranges in a do loop
 

Activesheet.Range("A1").Checkspelling AlwaysSuggest:=True, SpellLang:=2057

looks like it would only check spelling in cell A1.

Why not have it check the spelling in the cell you want spell checked

Activesheet.Range("B9").Checkspelling AlwaysSuggest:=True, SpellLang:=2057

perhaps

or
Application.Goto Reference:=Range(Address), scroll:=True
Selection.Checkspelling AlwaysSuggest:=True, SpellLang:=2057

--
Regards,
Tom Ogilvy

"Daveh" wrote:

I have a macro trying to spell check a number of discrete ranges ( not the
whole spread sheet). The range names are passed to the spell check sub
routine which uses the following lines of code

Application.Goto Reference:=Range(Address), scroll:=True
Application.union((activesheet.Range(Address)),
Activesheet.Range("A1").Checkspelling AlwaysSuggest:=True, SpellLang:=2057

The problem I have is that if there are 3 ranges (for example) I want to
spell check, it works fine for the first range, but doesn't work for the
later ranges.

I have checked the formatting of the cell ranges in the spreadsheet and thy
are all the same.

Thanks !

Daveh


Daveh

spell check ranges in a do loop
 
Selection.checkspelling worked fine

thanks !

Dave

"Tom Ogilvy" wrote:


Activesheet.Range("A1").Checkspelling AlwaysSuggest:=True, SpellLang:=2057

looks like it would only check spelling in cell A1.

Why not have it check the spelling in the cell you want spell checked

Activesheet.Range("B9").Checkspelling AlwaysSuggest:=True, SpellLang:=2057

perhaps

or
Application.Goto Reference:=Range(Address), scroll:=True
Selection.Checkspelling AlwaysSuggest:=True, SpellLang:=2057

--
Regards,
Tom Ogilvy

"Daveh" wrote:

I have a macro trying to spell check a number of discrete ranges ( not the
whole spread sheet). The range names are passed to the spell check sub
routine which uses the following lines of code

Application.Goto Reference:=Range(Address), scroll:=True
Application.union((activesheet.Range(Address)),
Activesheet.Range("A1").Checkspelling AlwaysSuggest:=True, SpellLang:=2057

The problem I have is that if there are 3 ranges (for example) I want to
spell check, it works fine for the first range, but doesn't work for the
later ranges.

I have checked the formatting of the cell ranges in the spreadsheet and thy
are all the same.

Thanks !

Daveh



All times are GMT +1. The time now is 02:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com