+ Reply to Thread
Results 1 to 5 of 5

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

  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:

    Please Login or Register  to view this content.

    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.

  2. #2
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

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

    Are you trying to loop through cells?

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

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

    yes. the loop works on other formulas, i am just having trouble with coming up with a formula that detects if these two cells 37/38 columns to the right of the current active cell are empty

  4. #4
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

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

    This would be a string to check if they are both empty

    Please Login or Register  to view this content.

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

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

    Thanks for the help rvasquez. your response led me down the right path. for anyone searching this topic, this is the end code i used to make my request work:

    Please Login or Register  to view this content.

+ 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