+ Reply to Thread
Results 1 to 3 of 3

formula to VBA

Hybrid View

mattress58 formula to VBA 01-04-2015, 11:18 AM
Kaper Re: formula to VBA 01-04-2015, 11:31 AM
StuCram Re: formula to VBA 01-04-2015, 11:45 AM
  1. #1
    Forum Contributor
    Join Date
    08-07-2013
    Location
    mo
    MS-Off Ver
    Excel 2010
    Posts
    453

    formula to VBA

    I am trying to get the formula below to VBA.

    =SMALL((I7,L7,N7),1+FREQUENCY((I7,L7,N7),0))

    here is what I have that is not working

    range("A1") = Application.WorksheetFunction.IfError(Application.WorksheetFunction.SMALL((Range("I70"),Range("L7"),Range("N7")),1+Application.WorksheetFunction.FREQUENCY(Range("I70"),Range("L7"),Range("N7")) , 0), "N/A")

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,864

    Re: formula to VBA

    range("A1") = Application.WorksheetFunction.IfError(Application.WorksheetFunction.SMALL((Range("I70"),Range("L7"),Range("N7")),1+Application.WorksheetFunction.FREQUENCY((Range("I70"),Range("L7"),Range("N7")) , 0)), "N/A")
    ps. there is probably also easier way. but added parentheses should help
    ps2. as usually, dummy workbok for tests would make answering easier.
    Best Regards,

    Kaper

  3. #3
    Valued Forum Contributor
    Join Date
    10-05-2014
    Location
    Regina, SK Canada
    MS-Off Ver
    Excel for Mac 11
    Posts
    330

    Re: formula to VBA

    Try this to insert the formula into cell A1:

    range("A1").formula = "=SMALL((I7,L7,N7),1+FREQUENCY((I7,L7,N7),0))"

    Hope this helps.
    -Stu

+ 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. Replies: 11
    Last Post: 06-06-2014, 03:34 PM
  2. how to hide formula in formula box, view lookup result in formula box?
    By vengatvj in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-14-2013, 04:06 PM

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