A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Spellcheck function in Protected Sheet



 
 
Thread Tools Display Modes
  #1  
Old January 25th, 2007, 06:03 PM posted to microsoft.public.excel.worksheet.functions
gwinder
external usenet poster
 
Posts: 7
Default Spellcheck function in Protected Sheet

I have created an employee review form that contains code which enables text
wrap in merged cells. I have protected the sheet but this disables the
spellcheck functionality. I've seen some threads where you can insert code
to allow spellcheck to work but where in the code would this go? At the end
of my exisiting code? At the beginning?

Thanks,

Gary
  #2  
Old January 25th, 2007, 06:37 PM posted to microsoft.public.excel.worksheet.functions
Gord Dibben
external usenet poster
 
Posts: 20,252
Default Spellcheck function in Protected Sheet

Gary

Sub Spell_Check()
ActiveSheet.Unprotect Password:="justme"
Cells.CheckSpelling SpellLang:=1033
ActiveSheet.Protect Password:="justme", DrawingObjects:=True, _
Contents:=True, Scenarios:=True
End Sub

Where in your code would it go?

Can't see your code so have no idea.

I assume the word wrap code is event code. Right?

You could run it by calling from your current code.

Just insert the line Spell_Check at a point you feel is appropriate.

Place the Spell_Check macro in a general module.


Gord Dibben Excel MVP

On Thu, 25 Jan 2007 10:03:01 -0800, gwinder
wrote:

I have created an employee review form that contains code which enables text
wrap in merged cells. I have protected the sheet but this disables the
spellcheck functionality. I've seen some threads where you can insert code
to allow spellcheck to work but where in the code would this go? At the end
of my exisiting code? At the beginning?

Thanks,

Gary


  #3  
Old January 26th, 2007, 02:08 AM posted to microsoft.public.excel.worksheet.functions
gwinder
external usenet poster
 
Posts: 7
Default Spellcheck function in Protected Sheet

Thanks Gord.

Yes...my code was stolen for the forum for the wrap text with merged cells.
I'll try this. Is "justme" the password?

Gary

"Gord Dibben" wrote:

Gary

Sub Spell_Check()
ActiveSheet.Unprotect Password:="justme"
Cells.CheckSpelling SpellLang:=1033
ActiveSheet.Protect Password:="justme", DrawingObjects:=True, _
Contents:=True, Scenarios:=True
End Sub

Where in your code would it go?

Can't see your code so have no idea.

I assume the word wrap code is event code. Right?

You could run it by calling from your current code.

Just insert the line Spell_Check at a point you feel is appropriate.

Place the Spell_Check macro in a general module.


Gord Dibben Excel MVP

On Thu, 25 Jan 2007 10:03:01 -0800, gwinder
wrote:

I have created an employee review form that contains code which enables text
wrap in merged cells. I have protected the sheet but this disables the
spellcheck functionality. I've seen some threads where you can insert code
to allow spellcheck to work but where in the code would this go? At the end
of my exisiting code? At the beginning?

Thanks,

Gary



  #4  
Old January 26th, 2007, 02:19 AM posted to microsoft.public.excel.worksheet.functions
gwinder
external usenet poster
 
Posts: 7
Default Spellcheck function in Protected Sheet

Gord....here's the code I have which is under Microsoft Excel Object, not a
module

So where would I put the spellcheck code? and how does a user activate the
spell check?

Thanks,

Gary

Private Sub Worksheet_Change(ByVal Target As Range)
Dim NewRwHt As Single
Dim cWdth As Single, MrgeWdth As Single
Dim c As Range, cc As Range
Dim ma As Range

With Target
If .MergeCells And .WrapText Then
Set c = Target.Cells(1, 1)
cWdth = c.ColumnWidth
Set ma = c.MergeArea
For Each cc In ma.Cells
MrgeWdth = MrgeWdth + cc.ColumnWidth
Next
Application.ScreenUpdating = False
On Error Resume Next
ma.MergeCells = False
c.ColumnWidth = MrgeWdth
c.EntireRow.AutoFit
NewRwHt = c.RowHeight
c.ColumnWidth = cWdth
ma.MergeCells = True
ma.RowHeight = NewRwHt
cWdth = 0: MrgeWdth = 0
On Error GoTo 0
Application.ScreenUpdating = True
End If
End With
End Sub

"Gord Dibben" wrote:

Gary

Sub Spell_Check()
ActiveSheet.Unprotect Password:="justme"
Cells.CheckSpelling SpellLang:=1033
ActiveSheet.Protect Password:="justme", DrawingObjects:=True, _
Contents:=True, Scenarios:=True
End Sub

Where in your code would it go?

Can't see your code so have no idea.

I assume the word wrap code is event code. Right?

You could run it by calling from your current code.

Just insert the line Spell_Check at a point you feel is appropriate.

Place the Spell_Check macro in a general module.


Gord Dibben Excel MVP

On Thu, 25 Jan 2007 10:03:01 -0800, gwinder
wrote:

I have created an employee review form that contains code which enables text
wrap in merged cells. I have protected the sheet but this disables the
spellcheck functionality. I've seen some threads where you can insert code
to allow spellcheck to work but where in the code would this go? At the end
of my exisiting code? At the beginning?

Thanks,

Gary



  #5  
Old January 26th, 2007, 03:08 AM posted to microsoft.public.excel.worksheet.functions
Gord Dibben
external usenet poster
 
Posts: 20,252
Default Spellcheck function in Protected Sheet

Yes, "justme" is a password.

You can change it in the code to one of your liking or have no password at all.

If you do change the PW make sure it is in quotes like "newpassword"
If none at all change to

ActiveSheet.Unprotect
ActiveSheet.Protect


Gord

On Thu, 25 Jan 2007 18:08:00 -0800, gwinder
wrote:

Thanks Gord.

Yes...my code was stolen for the forum for the wrap text with merged cells.
I'll try this. Is "justme" the password?

Gary

"Gord Dibben" wrote:

Gary

Sub Spell_Check()
ActiveSheet.Unprotect Password:="justme"
Cells.CheckSpelling SpellLang:=1033
ActiveSheet.Protect Password:="justme", DrawingObjects:=True, _
Contents:=True, Scenarios:=True
End Sub

Where in your code would it go?

Can't see your code so have no idea.

I assume the word wrap code is event code. Right?

You could run it by calling from your current code.

Just insert the line Spell_Check at a point you feel is appropriate.

Place the Spell_Check macro in a general module.


Gord Dibben Excel MVP

On Thu, 25 Jan 2007 10:03:01 -0800, gwinder
wrote:

I have created an employee review form that contains code which enables text
wrap in merged cells. I have protected the sheet but this disables the
spellcheck functionality. I've seen some threads where you can insert code
to allow spellcheck to work but where in the code would this go? At the end
of my exisiting code? At the beginning?

Thanks,

Gary




  #6  
Old January 26th, 2007, 03:15 AM posted to microsoft.public.excel.worksheet.functions
Gord Dibben
external usenet poster
 
Posts: 20,252
Default Spellcheck function in Protected Sheet

That is worksheet event code and I presume you have it in a sheet module.

It fires whenever you enter text into merged cells.

I misspoke in my first post.

You don't want to run spellcheck every time the event code fires so I would just
assign the Spell_Check macro to a button and run it whenever you choose.


Gord

On Thu, 25 Jan 2007 18:19:00 -0800, gwinder
wrote:

Gord....here's the code I have which is under Microsoft Excel Object, not a
module

So where would I put the spellcheck code? and how does a user activate the
spell check?

Thanks,

Gary

Private Sub Worksheet_Change(ByVal Target As Range)
Dim NewRwHt As Single
Dim cWdth As Single, MrgeWdth As Single
Dim c As Range, cc As Range
Dim ma As Range

With Target
If .MergeCells And .WrapText Then
Set c = Target.Cells(1, 1)
cWdth = c.ColumnWidth
Set ma = c.MergeArea
For Each cc In ma.Cells
MrgeWdth = MrgeWdth + cc.ColumnWidth
Next
Application.ScreenUpdating = False
On Error Resume Next
ma.MergeCells = False
c.ColumnWidth = MrgeWdth
c.EntireRow.AutoFit
NewRwHt = c.RowHeight
c.ColumnWidth = cWdth
ma.MergeCells = True
ma.RowHeight = NewRwHt
cWdth = 0: MrgeWdth = 0
On Error GoTo 0
Application.ScreenUpdating = True
End If
End With
End Sub

"Gord Dibben" wrote:

Gary

Sub Spell_Check()
ActiveSheet.Unprotect Password:="justme"
Cells.CheckSpelling SpellLang:=1033
ActiveSheet.Protect Password:="justme", DrawingObjects:=True, _
Contents:=True, Scenarios:=True
End Sub

Where in your code would it go?

Can't see your code so have no idea.

I assume the word wrap code is event code. Right?

You could run it by calling from your current code.

Just insert the line Spell_Check at a point you feel is appropriate.

Place the Spell_Check macro in a general module.


Gord Dibben Excel MVP

On Thu, 25 Jan 2007 10:03:01 -0800, gwinder
wrote:

I have created an employee review form that contains code which enables text
wrap in merged cells. I have protected the sheet but this disables the
spellcheck functionality. I've seen some threads where you can insert code
to allow spellcheck to work but where in the code would this go? At the end
of my exisiting code? At the beginning?

Thanks,

Gary




  #7  
Old January 27th, 2007, 12:57 AM posted to microsoft.public.excel.worksheet.functions
gwinder
external usenet poster
 
Posts: 7
Default Spellcheck function in Protected Sheet

Gord...could you explain exactly how to assign the Spell_Check macro to a
button please?

Thanks,\Gary

"Gord Dibben" wrote:

That is worksheet event code and I presume you have it in a sheet module.

It fires whenever you enter text into merged cells.

I misspoke in my first post.

You don't want to run spellcheck every time the event code fires so I would just
assign the Spell_Check macro to a button and run it whenever you choose.


Gord

On Thu, 25 Jan 2007 18:19:00 -0800, gwinder
wrote:

Gord....here's the code I have which is under Microsoft Excel Object, not a
module

So where would I put the spellcheck code? and how does a user activate the
spell check?

Thanks,

Gary

Private Sub Worksheet_Change(ByVal Target As Range)
Dim NewRwHt As Single
Dim cWdth As Single, MrgeWdth As Single
Dim c As Range, cc As Range
Dim ma As Range

With Target
If .MergeCells And .WrapText Then
Set c = Target.Cells(1, 1)
cWdth = c.ColumnWidth
Set ma = c.MergeArea
For Each cc In ma.Cells
MrgeWdth = MrgeWdth + cc.ColumnWidth
Next
Application.ScreenUpdating = False
On Error Resume Next
ma.MergeCells = False
c.ColumnWidth = MrgeWdth
c.EntireRow.AutoFit
NewRwHt = c.RowHeight
c.ColumnWidth = cWdth
ma.MergeCells = True
ma.RowHeight = NewRwHt
cWdth = 0: MrgeWdth = 0
On Error GoTo 0
Application.ScreenUpdating = True
End If
End With
End Sub

"Gord Dibben" wrote:

Gary

Sub Spell_Check()
ActiveSheet.Unprotect Password:="justme"
Cells.CheckSpelling SpellLang:=1033
ActiveSheet.Protect Password:="justme", DrawingObjects:=True, _
Contents:=True, Scenarios:=True
End Sub

Where in your code would it go?

Can't see your code so have no idea.

I assume the word wrap code is event code. Right?

You could run it by calling from your current code.

Just insert the line Spell_Check at a point you feel is appropriate.

Place the Spell_Check macro in a general module.


Gord Dibben Excel MVP

On Thu, 25 Jan 2007 10:03:01 -0800, gwinder
wrote:

I have created an employee review form that contains code which enables text
wrap in merged cells. I have protected the sheet but this disables the
spellcheck functionality. I've seen some threads where you can insert code
to allow spellcheck to work but where in the code would this go? At the end
of my exisiting code? At the beginning?

Thanks,

Gary




  #8  
Old January 27th, 2007, 05:49 PM posted to microsoft.public.excel.worksheet.functions
Gord Dibben
external usenet poster
 
Posts: 20,252
Default Spellcheck function in Protected Sheet

ViewToolbarsForms.

Click on the "Button" icon and draw a butoon on your worksheet.

Right-click and "assign macro".

Select the Spell_Check macro and OK.

Alternate method for putting a button on an existing Toolbar.

ToolsCustomizeCommands.

Scroll down to "Macros" and select.

Drag the smiley-face button to your toolbar and right-click and "assign macro"

You can also "rename" or "change button image" or "edit button image" if you
don't like the smiley or the word "Custom"


Gord

On Fri, 26 Jan 2007 16:57:01 -0800, gwinder
wrote:

Gord...could you explain exactly how to assign the Spell_Check macro to a
button please?

Thanks,\Gary

"Gord Dibben" wrote:

That is worksheet event code and I presume you have it in a sheet module.

It fires whenever you enter text into merged cells.

I misspoke in my first post.

You don't want to run spellcheck every time the event code fires so I would just
assign the Spell_Check macro to a button and run it whenever you choose.


Gord

On Thu, 25 Jan 2007 18:19:00 -0800, gwinder
wrote:

Gord....here's the code I have which is under Microsoft Excel Object, not a
module

So where would I put the spellcheck code? and how does a user activate the
spell check?

Thanks,

Gary

Private Sub Worksheet_Change(ByVal Target As Range)
Dim NewRwHt As Single
Dim cWdth As Single, MrgeWdth As Single
Dim c As Range, cc As Range
Dim ma As Range

With Target
If .MergeCells And .WrapText Then
Set c = Target.Cells(1, 1)
cWdth = c.ColumnWidth
Set ma = c.MergeArea
For Each cc In ma.Cells
MrgeWdth = MrgeWdth + cc.ColumnWidth
Next
Application.ScreenUpdating = False
On Error Resume Next
ma.MergeCells = False
c.ColumnWidth = MrgeWdth
c.EntireRow.AutoFit
NewRwHt = c.RowHeight
c.ColumnWidth = cWdth
ma.MergeCells = True
ma.RowHeight = NewRwHt
cWdth = 0: MrgeWdth = 0
On Error GoTo 0
Application.ScreenUpdating = True
End If
End With
End Sub

"Gord Dibben" wrote:

Gary

Sub Spell_Check()
ActiveSheet.Unprotect Password:="justme"
Cells.CheckSpelling SpellLang:=1033
ActiveSheet.Protect Password:="justme", DrawingObjects:=True, _
Contents:=True, Scenarios:=True
End Sub

Where in your code would it go?

Can't see your code so have no idea.

I assume the word wrap code is event code. Right?

You could run it by calling from your current code.

Just insert the line Spell_Check at a point you feel is appropriate.

Place the Spell_Check macro in a general module.


Gord Dibben Excel MVP

On Thu, 25 Jan 2007 10:03:01 -0800, gwinder
wrote:

I have created an employee review form that contains code which enables text
wrap in merged cells. I have protected the sheet but this disables the
spellcheck functionality. I've seen some threads where you can insert code
to allow spellcheck to work but where in the code would this go? At the end
of my exisiting code? At the beginning?

Thanks,

Gary





  #9  
Old January 28th, 2007, 03:07 AM posted to microsoft.public.excel.worksheet.functions
gwinder
external usenet poster
 
Posts: 7
Default Spellcheck function in Protected Sheet

Gord...you're brilliant...thank you. Works great but I don't get prompted
for the password?

Gary

"Gord Dibben" wrote:

ViewToolbarsForms.

Click on the "Button" icon and draw a butoon on your worksheet.

Right-click and "assign macro".

Select the Spell_Check macro and OK.

Alternate method for putting a button on an existing Toolbar.

ToolsCustomizeCommands.

Scroll down to "Macros" and select.

Drag the smiley-face button to your toolbar and right-click and "assign macro"

You can also "rename" or "change button image" or "edit button image" if you
don't like the smiley or the word "Custom"


Gord

On Fri, 26 Jan 2007 16:57:01 -0800, gwinder
wrote:

Gord...could you explain exactly how to assign the Spell_Check macro to a
button please?

Thanks,\Gary

"Gord Dibben" wrote:

That is worksheet event code and I presume you have it in a sheet module.

It fires whenever you enter text into merged cells.

I misspoke in my first post.

You don't want to run spellcheck every time the event code fires so I would just
assign the Spell_Check macro to a button and run it whenever you choose.


Gord

On Thu, 25 Jan 2007 18:19:00 -0800, gwinder
wrote:

Gord....here's the code I have which is under Microsoft Excel Object, not a
module

So where would I put the spellcheck code? and how does a user activate the
spell check?

Thanks,

Gary

Private Sub Worksheet_Change(ByVal Target As Range)
Dim NewRwHt As Single
Dim cWdth As Single, MrgeWdth As Single
Dim c As Range, cc As Range
Dim ma As Range

With Target
If .MergeCells And .WrapText Then
Set c = Target.Cells(1, 1)
cWdth = c.ColumnWidth
Set ma = c.MergeArea
For Each cc In ma.Cells
MrgeWdth = MrgeWdth + cc.ColumnWidth
Next
Application.ScreenUpdating = False
On Error Resume Next
ma.MergeCells = False
c.ColumnWidth = MrgeWdth
c.EntireRow.AutoFit
NewRwHt = c.RowHeight
c.ColumnWidth = cWdth
ma.MergeCells = True
ma.RowHeight = NewRwHt
cWdth = 0: MrgeWdth = 0
On Error GoTo 0
Application.ScreenUpdating = True
End If
End With
End Sub

"Gord Dibben" wrote:

Gary

Sub Spell_Check()
ActiveSheet.Unprotect Password:="justme"
Cells.CheckSpelling SpellLang:=1033
ActiveSheet.Protect Password:="justme", DrawingObjects:=True, _
Contents:=True, Scenarios:=True
End Sub

Where in your code would it go?

Can't see your code so have no idea.

I assume the word wrap code is event code. Right?

You could run it by calling from your current code.

Just insert the line Spell_Check at a point you feel is appropriate.

Place the Spell_Check macro in a general module.


Gord Dibben Excel MVP

On Thu, 25 Jan 2007 10:03:01 -0800, gwinder
wrote:

I have created an employee review form that contains code which enables text
wrap in merged cells. I have protected the sheet but this disables the
spellcheck functionality. I've seen some threads where you can insert code
to allow spellcheck to work but where in the code would this go? At the end
of my exisiting code? At the beginning?

Thanks,

Gary






  #10  
Old January 28th, 2007, 04:38 AM posted to microsoft.public.excel.worksheet.functions
Gord Dibben
external usenet poster
 
Posts: 20,252
Default Spellcheck function in Protected Sheet

You wouldn't because you have used the password in the code at

ActiveSheet.Unprotect Password:="justme"

'do the spellcheck

ActiveSheet.Protect Password:="justme"

If you don't want others to see your code protect the VBAProject "lock project
for viewing" with another password.

Gord


On Sat, 27 Jan 2007 19:07:00 -0800, gwinder
wrote:

Gord...you're brilliant...thank you. Works great but I don't get prompted
for the password?

Gary

"Gord Dibben" wrote:

ViewToolbarsForms.

Click on the "Button" icon and draw a butoon on your worksheet.

Right-click and "assign macro".

Select the Spell_Check macro and OK.

Alternate method for putting a button on an existing Toolbar.

ToolsCustomizeCommands.

Scroll down to "Macros" and select.

Drag the smiley-face button to your toolbar and right-click and "assign macro"

You can also "rename" or "change button image" or "edit button image" if you
don't like the smiley or the word "Custom"


Gord

On Fri, 26 Jan 2007 16:57:01 -0800, gwinder
wrote:

Gord...could you explain exactly how to assign the Spell_Check macro to a
button please?

Thanks,\Gary

"Gord Dibben" wrote:

That is worksheet event code and I presume you have it in a sheet module.

It fires whenever you enter text into merged cells.

I misspoke in my first post.

You don't want to run spellcheck every time the event code fires so I would just
assign the Spell_Check macro to a button and run it whenever you choose.


Gord

On Thu, 25 Jan 2007 18:19:00 -0800, gwinder
wrote:

Gord....here's the code I have which is under Microsoft Excel Object, not a
module

So where would I put the spellcheck code? and how does a user activate the
spell check?

Thanks,

Gary

Private Sub Worksheet_Change(ByVal Target As Range)
Dim NewRwHt As Single
Dim cWdth As Single, MrgeWdth As Single
Dim c As Range, cc As Range
Dim ma As Range

With Target
If .MergeCells And .WrapText Then
Set c = Target.Cells(1, 1)
cWdth = c.ColumnWidth
Set ma = c.MergeArea
For Each cc In ma.Cells
MrgeWdth = MrgeWdth + cc.ColumnWidth
Next
Application.ScreenUpdating = False
On Error Resume Next
ma.MergeCells = False
c.ColumnWidth = MrgeWdth
c.EntireRow.AutoFit
NewRwHt = c.RowHeight
c.ColumnWidth = cWdth
ma.MergeCells = True
ma.RowHeight = NewRwHt
cWdth = 0: MrgeWdth = 0
On Error GoTo 0
Application.ScreenUpdating = True
End If
End With
End Sub

"Gord Dibben" wrote:

Gary

Sub Spell_Check()
ActiveSheet.Unprotect Password:="justme"
Cells.CheckSpelling SpellLang:=1033
ActiveSheet.Protect Password:="justme", DrawingObjects:=True, _
Contents:=True, Scenarios:=True
End Sub

Where in your code would it go?

Can't see your code so have no idea.

I assume the word wrap code is event code. Right?

You could run it by calling from your current code.

Just insert the line Spell_Check at a point you feel is appropriate.

Place the Spell_Check macro in a general module.


Gord Dibben Excel MVP

On Thu, 25 Jan 2007 10:03:01 -0800, gwinder
wrote:

I have created an employee review form that contains code which enables text
wrap in merged cells. I have protected the sheet but this disables the
spellcheck functionality. I've seen some threads where you can insert code
to allow spellcheck to work but where in the code would this go? At the end
of my exisiting code? At the beginning?

Thanks,

Gary







 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:37 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.