Hi All,
I have a very simple request. I want to make the worksheet protected, however, when I protect the worksheet the macro will not run. Does anyone have any useful tips. Many thanks in anticipation.
Keith![]()
Hi All,
I have a very simple request. I want to make the worksheet protected, however, when I protect the worksheet the macro will not run. Does anyone have any useful tips. Many thanks in anticipation.
Keith![]()
Last edited by Keith Burgess; 06-10-2008 at 12:26 PM.
You need to remove and re-apply protection within your code.
You might want to consider remove the attached file as the content looks as though it may be confidential.![]()
Please Login or Register to view this content.
You could possibly use Protect with UserInterface, see an example here
http://www.excel-it.com/vba_examples.htm
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
Hi Andy,
Many thanks for your prompt reply. I have cut and pasted your ammended macro but it doesn't seem to work as before, where each line containing the search criteria was highlighted in yellow. Can you help me further, please?
Best regards
Keith
Works for me.
Run the macro and search for time.
EDIT: Confidential file removed
Last edited by Andy Pope; 06-11-2008 at 07:55 AM.
Hi Andy,
Sorry it doesn't work for me. When I run the nmacro and search for time it takes me to a line within the macro. Can you advise further, please.
Kind regards
Keith
It would help you posted the line in the macro it takes you to.Originally Posted by Keith Burgess
It works fine. The code finds any row where a cell contains "time2 and highlights it.
Hi Guys,
Below is the line in the macro it takes me to when I run the macro and ask it to search for time. I am using MS Office Excel 2003?
Hope this helps.![]()
Please Login or Register to view this content.
Kind regards
Keith
Last edited by royUK; 06-11-2008 at 04:00 AM.
Is the sheet you are searching active, i.e. the one open?
Hi Roy,
Many thanks for your reply. Yes! the sheet is active and open in fact it is the only worksheet in the workbook.
Kind regards
Keith
I ran andy's code in his example workbook with no errors.
Can you attach your workbook?
Hi Roy,
Here is the workbook in its original format.
Kind regards
Keith
Last edited by Keith Burgess; 06-11-2008 at 07:17 AM.
The code runs perfectly in your workbook.
Hi Roy,
Attached is a protected worksheet (password to unprotect is password). The macro will not run on a protected sheet. What I am trying to do is share the spreadsheet with colleagues and allow them to search for different criteria, however, I want to protect the worksheet so that my colleagues cannot alter any of the data therein. I hope you can help.
Kind regards
Keith
Last edited by Keith Burgess; 06-11-2008 at 07:21 AM.
If your sheet already has a password applied then you need to include that in the code where protection is removed and applied.
![]()
Please Login or Register to view this content.
Hi Guys,
Many thanks for working this out for me it now works like a charm. Special thanks go to Roy and Andy for their patience.
Best Wishes
Keith
Last edited by Keith Burgess; 06-11-2008 at 07:27 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks