+ Reply to Thread
Results 1 to 10 of 10

Insert excel formula to VBA

  1. #1
    Forum Contributor geliedee's Avatar
    Join Date
    10-14-2013
    Location
    Manila, philippines
    MS-Off Ver
    Excel 2007
    Posts
    399

    Insert excel formula to VBA

    Hi guys,

    Just wondering how can i insert this formula to my code in VBA:

    Excel fromula:

    Please Login or Register  to view this content.
    to this VBA Formula:


    Please Login or Register  to view this content.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,445

    Re: Insert excel formula to VBA

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: Insert excel formula to VBA

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    08-04-2014
    Location
    Riga
    MS-Off Ver
    2010
    Posts
    579

    Re: Insert excel formula to VBA

    The code for IF looks something like this in VBA:

    Please Login or Register  to view this content.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,445

    Re: Insert excel formula to VBA

    To get values:

    Please Login or Register  to view this content.


    Regards, TMS

  6. #6
    Forum Contributor geliedee's Avatar
    Join Date
    10-14-2013
    Location
    Manila, philippines
    MS-Off Ver
    Excel 2007
    Posts
    399

    Re: Insert excel formula to VBA

    Thanks guys for the help. Woprked fine but this is the correct formula i should paste

    Please Login or Register  to view this content.

  7. #7
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: Insert excel formula to VBA

    Quote Originally Posted by geliedee View Post
    Thanks guys for the help. Woprked fine but this is the correct formula i should paste

    Please Login or Register  to view this content.
    What do you mean?

    Use your macro recorder to see what the formula looks like in VBA

  8. #8
    Forum Contributor geliedee's Avatar
    Join Date
    10-14-2013
    Location
    Manila, philippines
    MS-Off Ver
    Excel 2007
    Posts
    399

    Re: Insert excel formula to VBA

    Sorry i pasted the incorrect formula:

    this one is incorrect:
    Please Login or Register  to view this content.
    This is the correct formula that i should be inserting in the cdoe below:

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  9. #9
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: Insert excel formula to VBA

    I explained in my previous post how to get the formula in VBA

  10. #10
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,445

    Re: Insert excel formula to VBA

    Please Login or Register  to view this content.

    Regards, TMS

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. excel formula calculation - how to insert the right formula
    By Manila.Boracay in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-17-2011, 04:21 AM
  2. Excel vba - Insert formula into cell
    By Swift4Play in forum Excel General
    Replies: 2
    Last Post: 11-21-2009, 11:03 PM
  3. Insert excel formula using VBA......MATCH function is what i want to insert
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-07-2009, 07:31 PM
  4. Insert Active Formula in Excel Cell with VBA
    By trex46 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-04-2008, 11:44 AM
  5. How do I set up a formula to insert text in excel?
    By nikki8327 in forum Excel General
    Replies: 5
    Last Post: 02-10-2005, 04:07 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