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. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|