+ Reply to Thread
Results 1 to 2 of 2

Quotes in a formula

Hybrid View

wilro85 Quotes in a formula 09-04-2007, 05:25 PM
Ikaabod There is more than one way...... 09-04-2007, 05:33 PM
  1. #1
    Forum Contributor
    Join Date
    09-02-2005
    Posts
    146

    Quotes in a formula

    If I have a cell that will have a formula like this:

    =IF(B11="n",SUM(I11)-(I11*J11),0)
    and I want to program that into multiple cells with VBA, how do I put in the quotes around the 'n'?

    For example:

    "=IF(B" & i & "='n',SUM(I" & i & ")-(I" & i & *J & "),0)"
    How do I fix that so that it will work?

  2. #2
    Valued Forum Contributor
    Join Date
    04-11-2006
    Posts
    407
    There is more than one way... here is one of them:
    Range("A" & i).Formula = _
          "=IF(B" & i & "=""n""" & ",SUM(I" & i & ")-(I" & i & "*J" & i & "),0)"

+ 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