+ Reply to Thread
Results 1 to 2 of 2

Excel Formula into DBA code

  1. #1
    Registered User
    Join Date
    10-31-2009
    Location
    S
    MS-Off Ver
    Excel 2003
    Posts
    25

    Excel Formula into DBA code

    I have the following formula in excel that I want to insert to my VBA code but do not know how to do it.
    The formula should post to sheet(9).Range(Q9) and grab the info from sheet(25) from the cells specified in the formula. The word "resta" in the formula is a variable.

    IF(AND(resta>$K$25,resta<$I$25),$G$25,
    IF(AND(resta>$K$26,resta<$I$26),$G$26,
    IF(AND(resta>$K$27,resta<$I$27),$G$27,
    IF(AND(resta>$K$28,resta<$I$28),$G$28,
    IF(AND(resta>$K$29,resta<$I$29),$G$29,
    IF(AND(resta>$K$30,resta<$I$30),$G$30,
    IF(AND(resta>$K$31,resta<$I$31),$G$31,
    IF(AND(resta>$K$32,resta<$I$32),$G$32,
    IF(AND(resta>$K$33,resta<$I$33),$G$33,
    IF(AND(resta>$K$34,resta<$I$34),$G$34,
    IF(AND(resta>$K$35,resta<$I$35),$G$35)))))))))))

    Any suggestions would be appreciated.

    Thanks

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Excel Formula into DBA code

    Can you post your existing code here and mention where you want this formula to be inserted?

    It will be much easier to help you if we see the whole code.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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