Results 1 to 8 of 8

Hide formula without password protecting sheet

Threaded View

Patnaik Hide formula without password... 01-18-2013, 01:38 AM
haripopuri Re: Hide formula without... 01-18-2013, 05:18 AM
Patnaik Re: Hide formula without... 01-18-2013, 06:11 AM
haripopuri Re: Hide formula without... 01-18-2013, 07:01 AM
Patnaik Re: Hide formula without... 01-18-2013, 08:34 AM
Patnaik Re: Hide formula without... 01-19-2013, 02:41 AM
Patnaik Re: Hide formula without... 01-23-2013, 09:30 AM
haripopuri Re: Hide formula without... 01-24-2013, 08:51 AM
  1. #1
    Forum Contributor
    Join Date
    08-22-2012
    Location
    Bhubaneswar
    MS-Off Ver
    Excel 2007
    Posts
    100

    Exclamation Hide formula without password protecting sheet

    Hi

    Friends

    i got one code in Google search, with that code we can hide the formula and get value of the formula in the formula bar

    The code is working fine when we use the Range Section, if we insert the row in given range then formula will display due to the range option extend from the code

    here is the code

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
        Dim Rng As Range
        Static Started As Boolean
        Static Cell As Range
        Static TheFormula As String
        Set Rng = Range("A1:A20")
        If Not Application.Intersect(ActiveCell, Rng) Is Nothing Then
            If Not Cell Is Nothing Then
                Cell.Formula = TheFormula
            End If
            Set Cell = ActiveCell
            With Cell
                TheFormula = .Formula
                .Value = .Value
            End With
            Started = True
        Else
            If Started Then
                With Cell
                    .Formula = TheFormula
                End With
            End If
        End If
    End Sub
    so my request is just remove the range section, i mean in the entire worksheet some cells has formula then when we select the cell then it will hide the formula and show only value. If some one insert the row above the formula then nothing effect the formula.


    hope you understand

    Thanks

    SP
    Last edited by Patnaik; 01-18-2013 at 01:41 AM. Reason: add some words

Thread Information

Users Browsing this Thread

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

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