I've found the code shown to Password Protcet a sheet, but I keep getting a Compile Error saying Variable Not Defined, can anyone help please?
![]()
Please Login or Register to view this content.
I've found the code shown to Password Protcet a sheet, but I keep getting a Compile Error saying Variable Not Defined, can anyone help please?
![]()
Please Login or Register to view this content.
Hi,
This works fine for me.
Do you have any other code in the worksheet module?
Rule 1: Never merge cells
Rule 2: See rule 1
"Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".
I can't attach sheet as I'm at work at the moment. Which sheet are you putting the code into? or does it go in a module?
Yes, as it's event driven (Private Sub Worksheet_Activate()) it needs to be in the worksheet where it will be used.
hi guys, I still can't see what I'm doing wrong, have attached a test file.
Hi,
This is quite odd. I got several errors while running your example sheet, but when I delete all the code and replace it manually (not cut and paste) it works. The only thing that I can guess is that you had unprintable characters in the code for some reason?
Hi Sweep,
yeah, I found exactly the same thing, I guess you are right about some unprintable characters. I'll mark this as solved.
Thanks again for your help
You had some Chr(160) characters (non-breaking spaces) - I suspect you pasted that code from a website?
To clear it you can use Ctrl+H, then click in the Find box, hold Alt and type 0160 on the number keypad, then release Alt and press Replace All.
Everyone who confuses correlation and causation ends up dead.
ok, thank you, something else learnt
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks