Results 1 to 5 of 5

VBA code for excel if formula

Threaded View

devawad VBA code for excel if formula 01-09-2014, 04:22 AM
hafizimran Re: VBA code for excel if... 01-09-2014, 04:28 AM
devawad Re: VBA code for excel if... 01-09-2014, 04:52 AM
hafizimran Re: VBA code for excel if... 01-09-2014, 05:38 AM
devawad Re: VBA code for excel if... 01-09-2014, 05:48 AM
  1. #4
    Forum Contributor
    Join Date
    12-31-2012
    Location
    Jhang, Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    250

    Re: VBA code for excel if formula

    In which place you are using this code?? I mean you should use it inside a macro or another procedure like this:
    Sub GetValue()
    
    Dim myVal As Variant
    
    myVal = IIf(Sheets("Na Cal").Range("B4").Value >= 1, Sheets("Na Cal").Range("B4").Value, "")
    'Now use this value somewhere, I'm putting it in A1
    Range("A1").Value = myVal
    
    End Sub
    Last edited by hafizimran; 01-09-2014 at 05:43 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 11-13-2013, 10:28 AM
  2. how to right excel formula with vba code.
    By Sushil.thakur in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-30-2013, 04:59 AM
  3. [SOLVED] Change my code into Excel formula code
    By DGARRETT1 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-04-2013, 07:51 PM
  4. [SOLVED] Excel formula to VBA code
    By purin0c0 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-26-2012, 03:18 PM
  5. Excel Formula in VBA code
    By kieranbop in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-12-2011, 10:24 AM

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