+ Reply to Thread
Results 1 to 7 of 7

Equation results depending on column width-in way to secure equations

  1. #1
    Registered User
    Join Date
    12-16-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    68

    Equation results depending on column width-in way to secure equations

    Dear all

    Can we have equation with dynamic to setting.


    Means.

    If column AA1 width changed from 0 to >0
    Equation at Cell B2 will be zero or O.

    Thanks
    Last edited by x_ampl1; 11-28-2020 at 09:07 AM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: Worksheet security.

    Short answer - no, you cannot have a formula that relies on column width to activate
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,336

    Re: Worksheet security.

    What does it have to do with security?

    Administrative Note:

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Worksheet security.

    You could have formulas evaluate to 0 using something like

    B2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    as soon as something triggers recalculation. Simply changing column widths or unhiding columns itself doesn't trigger recalculation or any worksheet, workbook or application events.

    If you mean changing column AA's width would replace the formula in cell B2 with 0, not immediately, but you could use a SelectionChange event handler macro to do that.

  5. #5
    Registered User
    Join Date
    12-16-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    68
    Quote Originally Posted by FDibbins View Post
    Short answer - no, you cannot have a formula that relies on column width to activate
    Thanks. For your share😊

  6. #6
    Registered User
    Join Date
    12-16-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    68
    Quote Originally Posted by AliGW View Post
    What does it have to do with security?

    Administrative Note:

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)



    Sorry for that.

    I had updated.

  7. #7
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Equation results depending on column width-in way to secure equations

    Let's try this again, if the moderators will permit.

    CELL("width",AA1) would be a way to determine whether column AA had width 0 (hidden) or positive (visible). However, just changing column width does trigger recalculation or any other event. You'd need to wait for some other event to change cell B2. If you wanted cell B2's formula to change to 0 (for security; thus your original title), you'd probably be best having Calculate, Change and SelectionChange events all call the same private procedure to check column AA's width, and if positive, change cell B2's formula.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. how to set security on a worksheet in vba
    By glda19 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-20-2019, 03:19 AM
  2. Worksheet security.
    By wladoD in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 06-30-2017, 12:11 AM
  3. Worksheet security
    By trev233 in forum Excel General
    Replies: 1
    Last Post: 10-08-2011, 11:53 AM
  4. Worksheet Security
    By Wanabe in forum Excel General
    Replies: 3
    Last Post: 08-30-2010, 06:53 PM
  5. Worksheet Security
    By mlk in forum Excel General
    Replies: 2
    Last Post: 03-14-2007, 07:34 PM
  6. Worksheet Security
    By babygoode in forum Excel General
    Replies: 1
    Last Post: 07-28-2006, 08:35 AM
  7. Worksheet Security
    By adey in forum Excel General
    Replies: 0
    Last Post: 11-23-2005, 01:01 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1