+ Reply to Thread
Results 1 to 8 of 8

Hide Formulae w/ VBA & NO Protect Worksheet or Workbook

  1. #1
    Forum Contributor
    Join Date
    12-22-2015
    Location
    San Antonio, Texas
    MS-Off Ver
    2016
    Posts
    116

    Hide Formulae w/ VBA & NO Protect Worksheet or Workbook

    I have searched online for VBA for my worksheet labelled "2019" to hide formulae. In it there are numerous formulae that reference other worksheets. I need a VBA that will hide formulae in the formula bar whenever any of the cells in worksheet titled "2019" is selected; only the calculated result will display. I cannot have the worksheet or the workbook password protected. If possible, I can have the VBA password protected, but I would need to be shown how to do that, too. The simpler the better. I could only find the VBA below, but it is for Kutools for ExtendOffice—something I don’t have. I don’t know if it is something remotely close to what I need. IF the below code could work, I don’t know what xDic and Dictionary—I don’t know what anything is, really—and the range would be the whole worksheet. PLEASE HELP ME, Excel gurus!

    Please Login or Register  to view this content.
    NOTE: This code is something I acquired from the Internet. In no way is it linked to my worksheet. I iterate: My worksheet is labelled "2019", and I need it to apply to the whole worksheet if a formula is posted in any of its cells. A user may add non-formula content in the future, so I don’t want the VBA to restrict it to just formula-based cells.
    Last edited by STBTC; 03-29-2019 at 03:37 PM. Reason: Code

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Hide Formulae w/ VBA & NO Protect Worksheet or Workbook

    I think that I can do what you need.

    However not until you comply with the Forum Rules.

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. 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, and it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Contributor
    Join Date
    12-22-2015
    Location
    San Antonio, Texas
    MS-Off Ver
    2016
    Posts
    116

    Re: Hide Formulae w/ VBA & NO Protect Worksheet or Workbook

    Mwhmetcik, I believe I did what you requested.

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Hide Formulae w/ VBA & NO Protect Worksheet or Workbook

    Right Click On Your Sheet Name At the Bottom Of Excel and Select View Code
    Paste this code in the module that opens and close it.

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    12-22-2015
    Location
    San Antonio, Texas
    MS-Off Ver
    2016
    Posts
    116

    Re: Hide Formulae w/ VBA & NO Protect Worksheet or Workbook

    I pasted the code as instructed, and was given the following error message:

    Run-time error '1004':
    Method 'Range' of object '_Worksheet' failed

  6. #6
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Hide Formulae w/ VBA & NO Protect Worksheet or Workbook

    Apologies

    It worked Yesterday.

    Try Pasting this into a normal Macro Module

    Please Login or Register  to view this content.

    And

    Right Click On Your Sheet Name At the Bottom Of Excel and Select View Code
    Paste this code in the module that opens and close it.


    Please Login or Register  to view this content.

    if this works then delete the first Macro leaving just this code in the normal macro modyule.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    12-22-2015
    Location
    San Antonio, Texas
    MS-Off Ver
    2016
    Posts
    116

    Re: Hide Formulae w/ VBA & NO Protect Worksheet or Workbook

    The error is still there:

    Run-time error '1004':
    Method 'Range' of object '_Worksheet' failed

  8. #8
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Hide Formulae w/ VBA & NO Protect Worksheet or Workbook

    I have attached an example that uses this code:

    Please Login or Register  to view this content.
    Attached Files Attached Files

+ 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. Hide Formulae in cell and to protect it with Password
    By jon112211 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-05-2015, 10:17 AM
  2. Hide formulas and protect workbook
    By Infish in forum Excel General
    Replies: 2
    Last Post: 09-27-2014, 03:53 PM
  3. Protect & hide sheet in workbook
    By Carrfamily in forum Excel General
    Replies: 6
    Last Post: 06-05-2013, 03:37 PM
  4. Replies: 2
    Last Post: 03-20-2009, 07:58 AM
  5. [SOLVED] Passwords Disappear in OpenOffice (Protect Worksheet, and Protect Workbook)
    By msnews.microsoft.com in forum Excel General
    Replies: 6
    Last Post: 12-27-2005, 04:20 AM
  6. [SOLVED] Protect hide worksheet
    By Lawrence in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-20-2005, 08:50 AM
  7. Replies: 5
    Last Post: 08-09-2005, 11:05 AM

Tags for this Thread

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