Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Apr 2001
    Location
    Warrington, Cheshire
    Posts
    355
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Is a formula in cell (Excel 97 sr2)

    Is there a way to establish in macro as to whether the current cell contains a formula?
    in the active sheet selection change event:-

    e.g. if isformula(activecell) then
    protect sheet
    else
    unprotect sheet
    end if


    TIA
    Alan

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Is a formula in cell (Excel 97 sr2)

    Try:

    <code>
    IF ActiveCell.HasFormula Then
    MsgBox "The active cell has a formula."
    Else
    MsgBox "The active cell does not contain a formula."
    End If
    </code>
    Legare Coleman

  3. #3
    3 Star Lounger
    Join Date
    Apr 2001
    Location
    Warrington, Cheshire
    Posts
    355
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Is a formula in cell (Excel 97 sr2)

    Cheers Legare.
    Worked a treat. <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

Posting Permissions

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