+ Reply to Thread
Results 1 to 2 of 2

Excel 2002 and VB Macro

  1. #1
    adavisRSC
    Guest

    Excel 2002 and VB Macro

    I'm trying to insert an Excel IF formula into cells where the logical test is
    based on employee names. If the name is found, it returns the employee's
    hourly rate, if not zero. Here is what I've done:

    Do Until IsEmpty(ActiveCell.Offset(0, -11))
    ActiveCell.FormulaR1C1 = "=IF(+RC[-5]="Smith, Joe",11,0)"
    ActiveCell.Offset(1, 0).Select
    Loop

    The problem is too many "s. I need to include the formula in "" and the
    string in "", but VB expects the first " of the string to be the end of the
    argument.

    How can I handle this?

    Thanks

  2. #2
    Vasant Nanavati
    Guest

    Re: Excel 2002 and VB Macro

    ActiveCell.FormulaR1C1 = "=IF(RC[-5]= ""Smith, Joe"" ,11,0)"

    --

    Vasant

    "adavisRSC" <[email protected]> wrote in message
    news:[email protected]...
    > I'm trying to insert an Excel IF formula into cells where the logical test

    is
    > based on employee names. If the name is found, it returns the employee's
    > hourly rate, if not zero. Here is what I've done:
    >
    > Do Until IsEmpty(ActiveCell.Offset(0, -11))
    > ActiveCell.FormulaR1C1 = "=IF(+RC[-5]="Smith, Joe",11,0)"
    > ActiveCell.Offset(1, 0).Select
    > Loop
    >
    > The problem is too many "s. I need to include the formula in "" and the
    > string in "", but VB expects the first " of the string to be the end of

    the
    > argument.
    >
    > How can I handle this?
    >
    > Thanks




+ 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