Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Help with "broken" formula!

A good while back I wrote the following formula:

=IF(PERSONAL.XLS!IsProtected.IsProtected(), "Protected", "Unprotected")

This formula was designed to use conditional formating and display the words
"Protected" or "Unprotected" in different colors to quickly identify if the
worksheet is protected or not.

Now that it is time to update the worksheet for a new year, the formula is
broken! All I get is "#NAME?". Unfortunately I don't remember what I did, or
understand what is going on well enough to debug, can anyone help?
  #2   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Help with "broken" formula!

Managed to get something like this to work over here ...

Press Alt+F11 to get to VBE
Click InsertModule
Copy n paste the UDF below (from a google trawl):

'-------
Function IsProtected() As Variant
Application.Volatile
IsProtected = Application.Caller.Parent.ProtectContents
End Function
'------

Press Alt+Q to get back to Excel

Placed in a worksheet cell:
=IF(isprotected(),"Protected", "Unprotected")

--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"SteveB" wrote:
A good while back I wrote the following formula:

=IF(PERSONAL.XLS!IsProtected.IsProtected(), "Protected", "Unprotected")

This formula was designed to use conditional formating and display the words
"Protected" or "Unprotected" in different colors to quickly identify if the
worksheet is protected or not.

Now that it is time to update the worksheet for a new year, the formula is
broken! All I get is "#NAME?". Unfortunately I don't remember what I did, or
understand what is going on well enough to debug, can anyone help?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Help with "broken" formula!

Unfortunately, this didn't work either!

I know I've some how "lost" some VBA code, I just don't know what it is! I
found the original idea/solution online somewhere the first time but I cannot
locate it now. Wish I had written down where I got it!

"Max" wrote:

Managed to get something like this to work over here ...

Press Alt+F11 to get to VBE
Click InsertModule
Copy n paste the UDF below (from a google trawl):

'-------
Function IsProtected() As Variant
Application.Volatile
IsProtected = Application.Caller.Parent.ProtectContents
End Function
'------

Press Alt+Q to get back to Excel

Placed in a worksheet cell:
=IF(isprotected(),"Protected", "Unprotected")

--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"SteveB" wrote:
A good while back I wrote the following formula:

=IF(PERSONAL.XLS!IsProtected.IsProtected(), "Protected", "Unprotected")

This formula was designed to use conditional formating and display the words
"Protected" or "Unprotected" in different colors to quickly identify if the
worksheet is protected or not.

Now that it is time to update the worksheet for a new year, the formula is
broken! All I get is "#NAME?". Unfortunately I don't remember what I did, or
understand what is going on well enough to debug, can anyone help?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Help with "broken" formula!

It could be a couple of things.

Do you still have a personal.xls?

This is the name that lots of people use to store macros that they want
available each time excel opens.

If you don't have this file anymore, you'll have to create it--and put a
function like Max posted in a General module in that workbook's project.

Ron de Bruin shares some info about personal.xls files he
http://www.rondebruin.nl/personal.htm

If you do have this file, you may not have the function (IsProtected) in this
version. Open up excel (and personal.xls) and then open the VBE (where macros
live) and look for a function named IsProtected in that workbook's project.

Another problem could be that you didn't enable macros when that workbook opened
(this is a long shot). I think that excel won't bother asking you if that
personal.xls workbook is in its correct home in your XLStart folder.



SteveB wrote:

A good while back I wrote the following formula:

=IF(PERSONAL.XLS!IsProtected.IsProtected(), "Protected", "Unprotected")

This formula was designed to use conditional formating and display the words
"Protected" or "Unprotected" in different colors to quickly identify if the
worksheet is protected or not.

Now that it is time to update the worksheet for a new year, the formula is
broken! All I get is "#NAME?". Unfortunately I don't remember what I did, or
understand what is going on well enough to debug, can anyone help?


--

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
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
look for a pipeID in a column and returns "broken" result Khoshravan Setting up and Configuration of Excel 4 May 5th 06 09:55 AM
"broken" y-axis in Excel charts burnsbyrne Charts and Charting in Excel 1 April 26th 06 04:26 PM


All times are GMT +1. The time now is 02:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"