+ Reply to Thread
Results 1 to 2 of 2

HasFormula

  1. #1
    John Wirt
    Guest

    HasFormula

    Can someone say what kinds of formulas are detected as being present in a
    cell by the HasFormula property?

    Some different kinds of formulas:

    =A30

    =A30/K$29

    =A20*A21

    =atan(A20)

    Also, can someone say what this statement will return and define as the
    rngDst.

    With ActiveCell
    ...
    Set rngDst = Range(.Formula)
    ...
    EndWith

    depending upon which of the above formulas is in the ActiveCell?

    Thank you.

    John Wirt



  2. #2
    Tom Ogilvy
    Guest

    Re: HasFormula

    Select all your cells and do Edit=>Goto=>Special and select Formlas.

    All you show would qualify as a formula.

    from the immediate window:

    ? activeCell.HasFormula
    True
    ? activeCell.Formula
    =10
    ActiveCell.Value = 10
    ? activeCell.HasFormula
    False
    ?ActiveCell.Formula
    10


    Your second question is that none of the formula strings are valid range
    references except =A30, so they would all return error except =A30.

    From the immediate window:

    ?Range("=A30").Address
    $A$30

    --
    Regards,
    Tom Ogilvy

    "John Wirt" <[email protected]> wrote in message
    news:[email protected]...
    > Can someone say what kinds of formulas are detected as being present in a
    > cell by the HasFormula property?
    >
    > Some different kinds of formulas:
    >
    > =A30
    >
    > =A30/K$29
    >
    > =A20*A21
    >
    > =atan(A20)
    >
    > Also, can someone say what this statement will return and define as the
    > rngDst.
    >
    > With ActiveCell
    > ...
    > Set rngDst = Range(.Formula)
    > ...
    > EndWith
    >
    > depending upon which of the above formulas is in the ActiveCell?
    >
    > Thank you.
    >
    > John Wirt
    >
    >




+ Reply to Thread

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