+ Reply to Thread
Results 1 to 10 of 10

Is it possible to hide formula without protect sheet feature in excel

  1. #1
    Registered User
    Join Date
    06-20-2022
    Location
    Doha,Qatar
    MS-Off Ver
    2019
    Posts
    74

    Is it possible to hide formula without protect sheet feature in excel

    Is there anyway(vba codes) to hide formula without protecting sheet?
    Last edited by KrishnaR; 07-21-2023 at 03:47 PM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Is it possible to hide formula without protect sheet feature in excel

    The only way that I can think of is to use VBA to prevent selection of a cell with a formula. You would use the Worksheet_SelectionChange sub for that worksheet, and check for either specific cells you are concerned about, or any cell with a formula. If the cell is selected, the code will select a different cell. You would also want to turn off the Formula Bar because the formula will be visible for a fraction of a second on selection, but the user can just turn it back on again.

    Also note that this method does not provide security because it won't work if a user does not enable VBA for the file.
    Attached Files Attached Files
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    06-20-2022
    Location
    Doha,Qatar
    MS-Off Ver
    2019
    Posts
    74

    Re: Is it possible to hide formula without protect sheet feature in excel

    but with your code,i cannot copy or paste in between the cells that has formula. i have formula from O2:O & lrow so i need to hide it.If i use hide n lock features it doesn't work properly.

    This is the code i m using.
    Please Login or Register  to view this content.
    Last edited by alansidman; 07-19-2023 at 05:01 PM.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,885

    Re: Is it possible to hide formula without protect sheet feature in excel

    @KrishnaR

    Code Tags Added
    Your post does not comply with Rule 2 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)

    However, if you continue to not use code tags, you can expect to have your thread BLOCKED until you add them yourself.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Is it possible to hide formula without protect sheet feature in excel

    Quote Originally Posted by KrishnaR View Post
    but with your code,i cannot copy or paste in between the cells that has formula.....

    This is the code i m using.
    I don't see how this code relates to "cannot copy or paste in between the cells". That code puts formulas in blank cells, it does not copy or paste anything. And it should not interact with the code I gave you since you turn off events to do it.

    You are adding requirements that you did not include in your first post. I answered just what you gave us to start with.

    Please provide a sample file and explain everything you need to do.

  6. #6
    Registered User
    Join Date
    06-20-2022
    Location
    Doha,Qatar
    MS-Off Ver
    2019
    Posts
    74

    Re: Is it possible to hide formula without protect sheet feature in excel

    i need to hide my formula mentioned in the code,i dnt want formula to be shown even when i click on those respective cells.

  7. #7
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Is it possible to hide formula without protect sheet feature in excel


    Hi,

    so you must protect cells and the worksheet or stop to use Excel for a database software …

  8. #8
    Registered User
    Join Date
    06-20-2022
    Location
    Doha,Qatar
    MS-Off Ver
    2019
    Posts
    74

    Re: Is it possible to hide formula without protect sheet feature in excel

    alright thanks

  9. #9
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Is it possible to hide formula without protect sheet feature in excel

    Quote Originally Posted by KrishnaR View Post
    i need to hide my formula mentioned in the code,i dnt want formula to be shown even when i click on those respective cells.
    Sheet protection is the only to be able to click on a cell with a formula and hide the formula.

  10. #10
    Registered User
    Join Date
    06-20-2022
    Location
    Doha,Qatar
    MS-Off Ver
    2019
    Posts
    74

    Re: Is it possible to hide formula without protect sheet feature in excel

    alrigh.thank you for your time.

+ 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 hide & unhide protect sheet when Protect Workbook is active
    By VisionSmart in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-19-2021, 06:50 AM
  2. 'Protect Sheet' feature is not consistently working
    By sb212410 in forum Excel General
    Replies: 0
    Last Post: 04-11-2018, 09:20 AM
  3. [SOLVED] how to create hide excel feature using logic date formula
    By R3CON3D in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-03-2013, 08:44 AM
  4. Protect & hide sheet in workbook
    By Carrfamily in forum Excel General
    Replies: 6
    Last Post: 06-05-2013, 03:37 PM
  5. Protect Sheet with VBM Hide Formula
    By [email protected] in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-21-2013, 06:59 AM
  6. [SOLVED] Protect and Hide a sheet
    By rlkerr in forum Excel General
    Replies: 3
    Last Post: 11-02-2010, 02:31 PM
  7. Hide & protect sheet
    By Doctorul in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-19-2009, 05:50 AM

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