+ Reply to Thread
Results 1 to 3 of 3

Split function and "expecting array" error message

  1. #1
    Forum Contributor JP Romano's Avatar
    Join Date
    10-09-2008
    Location
    Princeton, NJ
    MS-Off Ver
    2010
    Posts
    500

    Split function and "expecting array" error message

    Hi all,
    I'm getting an error that I'm not quite clear about. I'm essentially using a fuction that Mr. Leith Ross provided here: http://www.excelforum.com/excel-prog...xt-source.html to grab text from a web page.

    I want to create 100 rows of data based on the array housing that data using the SPLIT function.


    Please Login or Register  to view this content.
    I'm hoping to take the first 100 lines of code (x) as delimted by a semicolon, and write them into the first 100 lines of column A.

    However, I'm getting an error message "Compile Error. Expected Array" on the line Range("A" & y") = x(y) ... spefically on the "x"

    What am I doing wrong? Arrays are fairly new to me, so be gentle
    Last edited by JP Romano; 11-02-2009 at 03:46 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Split function and "expecting array" error message

    You have declared x as a String rather than as a Variant
    (it [x] will become a Variant Array via the Split)

  3. #3
    Forum Contributor JP Romano's Avatar
    Join Date
    10-09-2008
    Location
    Princeton, NJ
    MS-Off Ver
    2010
    Posts
    500

    Re: Split function and "expecting array" error message

    Wow...that's it? Thank you sir!
    Works like a charm!

+ 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