Results 1 to 5 of 5

need assistance with VBA language for blank cells in an If statement

Threaded View

  1. #1
    Registered User
    Join Date
    11-17-2011
    Location
    Columbus, OH
    MS-Off Ver
    Excel 2007
    Posts
    43

    need assistance with VBA language for blank cells in an If statement

    I am running code that iterates a formula starting in cell V2 through a variable 'n' that is defined by the number of constants in an adjacent column. The excel formula i am trying to copy down is as follows: =IF(OR(BG2="",BH2=""),"No","Yes")
    BG2 and BH2 are dates if it matters. basically, if either of those cells are blank, the returning value is no. if they both have values, return yes.

    this is the code i am trying to use:

    Range("V2").Select
        For i = 1 To n
            ActiveCell.Formula = "=If(OR(isblank(RC[37]),isblank(RC[38]),""No"",""Yes"")"
            ActiveCell.Offset(1, 0).Select
        next i

    i get a runtime 1004 application defined or object defined error. all variables are defined. i think it has something to do with isblank. i have tried using """" as well for a blank status and i get the same error.

    Can anyone help with a work around?
    Last edited by DFrank231; 07-23-2012 at 03:53 PM.

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