Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Find and Replace HELP!

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!!!

  #2   Report Post  
Posted to microsoft.public.excel.programming
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find and Replace HELP!

no, it is the only protected worksheet in the workbook. it only has 2 sheets at the moment.

when you did this bit of code, did it not "re-protect" the worksheet before you did anything with the find/replace dialog box? this is the problem i had with that function, the box wasn't modal so it just re-protected the worksheet before i could replace anything

thank so much for responding

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Find and Replace HELP!

well, i am confused. i tried it again with nothing being changed and the message telling me that the workbook was protected. so i pasted your code on top of mine, since i didn't use With, and nothing
so i tried again, this time i used By Columns instead, and it worked.
i switched back to By Rows, and it works.

now, it seems to work fine.

i've no idea, but, thanks!!




----- Dave Peterson wrote: ----

I can't reproduce that behavior

Any chance you're protecting too many sheets

Option Explici
Sub testme(

With ActiveShee
.Unprotect Password:="hi
Application.Dialogs(xlDialogFormulaReplace).Sho
.Protect Password:="hi
End Wit

End Su

didn't affect any other sheet (xl2002)

alfaista wrote
this seems to be that it should be easy, but i am havin

a heck of a time and any help would be greatl
appreciated
what i have is a protected worksheet. but i want th

users to be able to do a mass replace on their formula
if they wish. you cannot do that unless you unprotec
the worksheet
first, i thought i would create a command button on m

custom toolbar that simply unprotects the worksheet, use
the bulit-in dialog box of xlDialogFormulaReplace, an
then protect the worksheet again. well, it works jus
fine, except if you use it, it disables the normal Edi
menu Find/Replace capability for the whole workbook. an
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 th

worksheet, then use the Execute method of the popu
command that is Replace, from the Edit menu. and the
lock the worksheet back up
well, this works great, i prefer the replace dialog yo

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 yo
can use the dialog box!
surely someone else has done this!! if so PLEASE let m

know how you got around it
thanks much!!


--

Dave Peterso


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Find and Replace HELP!

I'd call that an excellent fix!

Take credit for it and walk away fast.

alfaista wrote:

well, i am confused. i tried it again with nothing being changed and the message telling me that the workbook was protected. so i pasted your code on top of mine, since i didn't use With, and nothing.
so i tried again, this time i used By Columns instead, and it worked.
i switched back to By Rows, and it works.

now, it seems to work fine.

i've no idea, but, thanks!!!


----- Dave Peterson wrote: -----

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



--

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
Find & Replace: find part cell, replace whole cell katy Excel Worksheet Functions 3 April 3rd 23 01:20 PM
Find and Replace - Replace with Blank Space Studebaker Excel Discussion (Misc queries) 4 April 3rd 23 10:55 AM
Find and replace results can the appearance of find be different? LLS at DPW Excel Discussion (Misc queries) 2 October 26th 09 11:16 PM
where to put results of find operation in find and replace functio DEP Excel Worksheet Functions 5 November 15th 06 07:52 PM
find and replace - replace data in rows to separated by commas msdker Excel Worksheet Functions 1 April 15th 06 01:00 AM


All times are GMT +1. The time now is 02:05 AM.

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"