+ Reply to Thread
Results 1 to 4 of 4

#name in match

  1. #1

    #name in match

    I am using vba in an automation routine.
    As part of this, I have a column A full of dates.
    "oneyear" is defined as a date.
    "numberrows" is an integer that is determined earlier to identify the
    number of rows in the range. It works.
    I am using match because I want the row number identified.

    Range("f2").Select
    ActiveCell.FormulaR1C1 = "=match(oneyear,r[-1]c[-5]:r[" & numberrows -
    2 & "]c[-5],1)"

    After this code runs, I get a #Name? in F2.
    I am not sure why. Any ideas would be appreciated.

    TIA


  2. #2
    Bob Phillips
    Guest

    Re: #name in match

    That sounds like you don't really have a name called 'oneyear'. Check the
    spelling of it again.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    <[email protected]> wrote in message
    news:[email protected]...
    > I am using vba in an automation routine.
    > As part of this, I have a column A full of dates.
    > "oneyear" is defined as a date.
    > "numberrows" is an integer that is determined earlier to identify the
    > number of rows in the range. It works.
    > I am using match because I want the row number identified.
    >
    > Range("f2").Select
    > ActiveCell.FormulaR1C1 = "=match(oneyear,r[-1]c[-5]:r[" & numberrows -
    > 2 & "]c[-5],1)"
    >
    > After this code runs, I get a #Name? in F2.
    > I am not sure why. Any ideas would be appreciated.
    >
    > TIA
    >




  3. #3
    Niek Otten
    Guest

    Re: #name in match

    You may have Dimmed the name in VBA, not defined in the spreadsheet
    If so, get it outside the quotes

    --
    Kind regards,

    Niek Otten

    "Bob Phillips" <[email protected]> wrote in message
    news:OuO8xdp%[email protected]...
    > That sounds like you don't really have a name called 'oneyear'. Check the
    > spelling of it again.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > <[email protected]> wrote in message
    > news:[email protected]...
    >> I am using vba in an automation routine.
    >> As part of this, I have a column A full of dates.
    >> "oneyear" is defined as a date.
    >> "numberrows" is an integer that is determined earlier to identify the
    >> number of rows in the range. It works.
    >> I am using match because I want the row number identified.
    >>
    >> Range("f2").Select
    >> ActiveCell.FormulaR1C1 = "=match(oneyear,r[-1]c[-5]:r[" & numberrows -
    >> 2 & "]c[-5],1)"
    >>
    >> After this code runs, I get a #Name? in F2.
    >> I am not sure why. Any ideas would be appreciated.
    >>
    >> TIA
    >>

    >
    >




  4. #4
    Bob Phillips
    Guest

    Re: #name in match

    So many possible errors :-))

    Bob


    "Niek Otten" <[email protected]> wrote in message
    news:%23e4GPop%[email protected]...
    > You may have Dimmed the name in VBA, not defined in the spreadsheet
    > If so, get it outside the quotes
    >
    > --
    > Kind regards,
    >
    > Niek Otten
    >
    > "Bob Phillips" <[email protected]> wrote in message
    > news:OuO8xdp%[email protected]...
    > > That sounds like you don't really have a name called 'oneyear'. Check

    the
    > > spelling of it again.
    > >
    > > --
    > >
    > > HTH
    > >
    > > RP
    > > (remove nothere from the email address if mailing direct)
    > >
    > >
    > > <[email protected]> wrote in message
    > > news:[email protected]...
    > >> I am using vba in an automation routine.
    > >> As part of this, I have a column A full of dates.
    > >> "oneyear" is defined as a date.
    > >> "numberrows" is an integer that is determined earlier to identify the
    > >> number of rows in the range. It works.
    > >> I am using match because I want the row number identified.
    > >>
    > >> Range("f2").Select
    > >> ActiveCell.FormulaR1C1 = "=match(oneyear,r[-1]c[-5]:r[" & numberrows -
    > >> 2 & "]c[-5],1)"
    > >>
    > >> After this code runs, I get a #Name? in F2.
    > >> I am not sure why. Any ideas would be appreciated.
    > >>
    > >> TIA
    > >>

    > >
    > >

    >
    >




+ 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