+ Reply to Thread
Results 1 to 9 of 9

Unable to set the property of the class range FormulaArray in VBA

  1. #1
    Registered User
    Join Date
    12-21-2011
    Location
    france
    MS-Off Ver
    Excel 2007
    Posts
    6

    Unable to set the property of the class range FormulaArray in VBA

    This is my formula to find the lookup array values from col C and paste it in the Col D.

    Please Login or Register  to view this content.
    If i enter more than 10 items in here, lets say 12 items I getting a error message "Unable to set the property of the class range FormulaArray in VBA"

    Please Login or Register  to view this content.
    I want to enter 30 items in the array & perform the match the values & paste in the COl D!!

    Thank u guys!!

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Unable to set the property of the class range FormulaArray in VBA

    I don't get an error.
    What do you assign to this array ?

    you can also try:
    Please Login or Register  to view this content.
    that saves you a loop.
    Last edited by snb; 12-21-2011 at 07:37 AM.



  3. #3
    Valued Forum Contributor mohd9876's Avatar
    Join Date
    05-04-2011
    Location
    Amman, Jordan
    MS-Off Ver
    Excel 2010
    Posts
    426

    Re: Unable to set the property of the class range FormulaArray in VBA

    try using .Formula instead of .FormulaArray
    Please Login or Register  to view this content.

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Unable to set the property of the class range FormulaArray in VBA

    You are limited to about 255 characters in the FormulaArray property. If you put your search array into a range, it would make the formula simpler, and the code easier to maintain.
    Remember what the dormouse said
    Feed your head

  5. #5
    Registered User
    Join Date
    12-21-2011
    Location
    france
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Unable to set the property of the class range FormulaArray in VBA

    Thanks guys, since I'm limited to enter only 255 characters so I couldn't enter more than lets say 10 items in my array
    vArray = Array("Windows XP", "Adobe", "IBM", "VLC", ".Net Framework", "Office", "Java", "Windows Media", "J2SE", "MSXML")
    How can split my array into multiple arrays because I would like to have more than 30 items.

    ThisWorkbook.Names.Add Name:="MyList", RefersTo:=Array(Array("Windows XP", "Adobe", "IBM"))
    & refer to my array formula here:
    Range("D2").FormulaArray = "=INDEX(" & sString & ",1,MATCH(1,--ISNUMBER(SEARCH(" & sString & ",$C2,1)),0))"
    @mohd9876: your formula didn't work, it simple put the name space elements in the all the cels of col d.

    I shared the original file here: http://www.uploadmb.com/dw.php?id=1324468049
    Last edited by karthikin; 12-21-2011 at 08:50 AM. Reason: QUOTE

  6. #6
    Registered User
    Join Date
    12-21-2011
    Location
    france
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Unable to set the property of the class range FormulaArray in VBA

    @snb : could you please explain me a bit more. How can i integrate your formula in my code. Thank you.

  7. #7
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Unable to set the property of the class range FormulaArray in VBA

    I think you'd better explain what you want, because if i get it right you are designing a circular formula.
    Please post a sample workbook.

  8. #8
    Registered User
    Join Date
    12-21-2011
    Location
    france
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Unable to set the property of the class range FormulaArray in VBA

    ok. I have a CSV file to remove the special characters http://www.uploadmb.com/dw.php?id=1324468049 then after removing 2 cols finally I have col A, B, C.

    In col C, i have bunch of software names like this for example "Adobe Download Manager 2.0 (Supprimer uniquement)". So in col C i want to look for these values
    "Windows XP", "Adobe", "IBM", "VLC", ".Net Framework", "Office", "Java", "Windows Media", "J2SE", "MSXML"
    if match found put in the Col D.

    According to my formula I couldn't enter more than 255 ch in the array.(I have more than 50 items to find out from col Cit could be around 600 characters).

    I simply don't know how to solve this. Thank you very much.

    Here is my full code:
    Please Login or Register  to view this content.
    Last edited by karthikin; 12-21-2011 at 09:19 AM. Reason: code

  9. #9
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Unable to set the property of the class range FormulaArray in VBA

    This this blog entry on the limitation and how to get around it by using a second step to replace short list with long list.
    http://www.dailydoseofexcel.com/arch...rmulas-in-vba/

    You may still run into formula length issues depending on the items in the list.
    Cheers
    Andy
    www.andypope.info

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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