+ Reply to Thread
Results 1 to 4 of 4

Is it possible to write an If function within a sub??

  1. #1
    Registered User
    Join Date
    07-25-2012
    Location
    Ireland
    MS-Off Ver
    Excel 2007
    Posts
    10

    Is it possible to write an If function within a sub??

    I am pulling data from one workbook and inputting it into a second, and returning calculations from the seond to the first workbook. I was wondering is it possible to write and If funtion within my sub, so that when a cell I pull from the first workbook goes below a certain value it automatically inputs a certain number

    Please Login or Register  to view this content.
    Want something like this however this does not work
    Last edited by arlu1201; 08-01-2012 at 07:05 AM.

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

    Re: Is it possible to write an If function within a sub??

    Welcome to the forum.

    I have added code tags to your post. As per forum rule 3, you need to use them whenever you put any code in your post. Please add them in future. If you need more information on how to use them, check my signature.

    Try this
    Please Login or Register  to view this content.
    Last edited by arlu1201; 08-01-2012 at 07:17 AM.
    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]

  3. #3
    Registered User
    Join Date
    07-25-2012
    Location
    Ireland
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Is it possible to write an If function within a sub??

    Thanks that did the job

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

    Re: Is it possible to write an If function within a sub??

    Am glad it worked.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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