+ Reply to Thread
Results 1 to 6 of 6

Debug Error Expected Array: Highlights my UBound statement

  1. #1
    Valued Forum Contributor
    Join Date
    02-04-2009
    Location
    Texas
    MS-Off Ver
    Excel 2016
    Posts
    665

    Debug Error Expected Array: Highlights my UBound statement

    Under Advice - I added Option Explicit to all of my vba code - and then ran Debug
    I am getting : Expected Array with UBound highlighted in this code ( which I borrowed)

    Please Login or Register  to view this content.
    I set sq as:
    Please Login or Register  to view this content.
    on previous error - did I set that up as the wrong type of object?

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Debug Error Expected Array: Highlights my UBound statement

    You have to define ALLLLLL variables with Option Explicit.

    What is j? What is jj? What is x? What is sn? They all need dimensions.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Debug Error Expected Array: Highlights my UBound statement

    Dim sq as variant
    or
    just
    Dim sq

  4. #4
    Valued Forum Contributor
    Join Date
    02-04-2009
    Location
    Texas
    MS-Off Ver
    Excel 2016
    Posts
    665

    Re: Debug Error Expected Array: Highlights my UBound statement

    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor
    Join Date
    02-04-2009
    Location
    Texas
    MS-Off Ver
    Excel 2016
    Posts
    665

    Re: Debug Error Expected Array: Highlights my UBound statement

    Dim sq as variant gets me past the error

    Now if it works we well be rosy

  6. #6
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Debug Error Expected Array: Highlights my UBound statement

    hehe that's snb's code for you...

+ 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. [SOLVED] Please help with Expected: end of statement error
    By Ocean Zhang in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-05-2015, 03:28 PM
  2. compile error expected line number statement end statement
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2014, 10:12 AM
  3. [SOLVED] "Run-time error '1004': App-dfnd or objt-dfnd err" Debug highlights ActiActiveCell.offset
    By GMAGANA in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-29-2014, 03:25 PM
  4. debug error at mutiple condition If statement
    By nikko50 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-24-2014, 07:25 PM
  5. [SOLVED] Compile Error: Expected: End of Statement
    By eemiller1997 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-14-2012, 09:37 AM
  6. Replies: 4
    Last Post: 05-16-2012, 05:33 PM
  7. How to fix a Compile Error Expected: End of statement.
    By AKarmyguy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-03-2010, 02:19 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