View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default Find and Replace HELP!

I can't reproduce that behavior.

Any chance you're protecting too many sheets?

Option Explicit
Sub testme()

With ActiveSheet
.Unprotect Password:="hi"
Application.Dialogs(xlDialogFormulaReplace).Show
.Protect Password:="hi"
End With

End Sub

didn't affect any other sheet (xl2002).

alfaista wrote:

this seems to be that it should be easy, but i am having
a heck of a time and any help would be greatly
appreciated!

what i have is a protected worksheet. but i want the
users to be able to do a mass replace on their formulas
if they wish. you cannot do that unless you unprotect
the worksheet.

first, i thought i would create a command button on my
custom toolbar that simply unprotects the worksheet, uses
the bulit-in dialog box of xlDialogFormulaReplace, and
then protect the worksheet again. well, it works just
fine, except if you use it, it disables the normal Edit
menu Find/Replace capability for the whole workbook. and
i don't want to do that. it doesn't give you any errors,
just won't work when you select them from the menu.
nothing happens at all.

so, i thought i would make the button unlock the
worksheet, then use the Execute method of the popup
command that is Replace, from the Edit menu. and then
lock the worksheet back up.

well, this works great, i prefer the replace dialog you
get from the Edit menu anyway. but, it does the Execute,
and doesn't stop, it isn't modal. so it just unlocks,
shows the dialog box, and locks right back up before you
can use the dialog box!!

surely someone else has done this!! if so PLEASE let me
know how you got around it!

thanks much!!!


--

Dave Peterson