+ Reply to Thread
Results 1 to 4 of 4

please explain this syntax

  1. #1
    Papa Jonah
    Guest

    please explain this syntax

    cells(r+1,"af").formula= "= countif(" & rngbas.address & "," & cells(r+1,
    "AE").address & ")"

    I think this means that a formula is being inserted in cell (r+1,af).
    The formula is counting all of the occurrences of the contents of cell(r+1,
    ae) that can be found in a particular range.
    I know that rngbas is a range.
    I do not understand the rngbas.address or the second mention of .address.

    Please interpret for me.
    TIA
    Jeff

  2. #2
    Simon Murphy
    Guest

    RE: please explain this syntax

    Youre right
    This snippet inserts a Countif formula in col AF (at row r+1)
    Countif takes 2 arguments the range to check and the critiiria
    rngbas.address is the reference to the cells to be counted (must be defined
    earlier in the code)
    cells(r+1, "AE").address is a reference to a cell that contains the criteria
    on which to count them

    HTH
    Cheers
    Simon

    "Papa Jonah" wrote:

    > cells(r+1,"af").formula= "= countif(" & rngbas.address & "," & cells(r+1,
    > "AE").address & ")"
    >
    > I think this means that a formula is being inserted in cell (r+1,af).
    > The formula is counting all of the occurrences of the contents of cell(r+1,
    > ae) that can be found in a particular range.
    > I know that rngbas is a range.
    > I do not understand the rngbas.address or the second mention of .address.
    >
    > Please interpret for me.
    > TIA
    > Jeff


  3. #3
    Papa Jonah
    Guest

    RE: please explain this syntax

    But why the ".address" following "cells(r+1,"AE")? Isn't cells(r+1,"AE")
    already an address?

    "Simon Murphy" wrote:

    > Youre right
    > This snippet inserts a Countif formula in col AF (at row r+1)
    > Countif takes 2 arguments the range to check and the critiiria
    > rngbas.address is the reference to the cells to be counted (must be defined
    > earlier in the code)
    > cells(r+1, "AE").address is a reference to a cell that contains the criteria
    > on which to count them
    >
    > HTH
    > Cheers
    > Simon
    >
    > "Papa Jonah" wrote:
    >
    > > cells(r+1,"af").formula= "= countif(" & rngbas.address & "," & cells(r+1,
    > > "AE").address & ")"
    > >
    > > I think this means that a formula is being inserted in cell (r+1,af).
    > > The formula is counting all of the occurrences of the contents of cell(r+1,
    > > ae) that can be found in a particular range.
    > > I know that rngbas is a range.
    > > I do not understand the rngbas.address or the second mention of .address.
    > >
    > > Please interpret for me.
    > > TIA
    > > Jeff


  4. #4
    gocush
    Guest

    RE: please explain this syntax

    When you reference a cell: cells(r+1,"AE") the default result is the VALUE
    in the cell, not the address of the cell. If you want the address you have
    to state that with cells(r+1,"AE").address

    "Papa Jonah" wrote:

    > But why the ".address" following "cells(r+1,"AE")? Isn't cells(r+1,"AE")
    > already an address?
    >
    > "Simon Murphy" wrote:
    >
    > > Youre right
    > > This snippet inserts a Countif formula in col AF (at row r+1)
    > > Countif takes 2 arguments the range to check and the critiiria
    > > rngbas.address is the reference to the cells to be counted (must be defined
    > > earlier in the code)
    > > cells(r+1, "AE").address is a reference to a cell that contains the criteria
    > > on which to count them
    > >
    > > HTH
    > > Cheers
    > > Simon
    > >
    > > "Papa Jonah" wrote:
    > >
    > > > cells(r+1,"af").formula= "= countif(" & rngbas.address & "," & cells(r+1,
    > > > "AE").address & ")"
    > > >
    > > > I think this means that a formula is being inserted in cell (r+1,af).
    > > > The formula is counting all of the occurrences of the contents of cell(r+1,
    > > > ae) that can be found in a particular range.
    > > > I know that rngbas is a range.
    > > > I do not understand the rngbas.address or the second mention of .address.
    > > >
    > > > Please interpret for me.
    > > > TIA
    > > > Jeff


+ 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