+ Reply to Thread
Results 1 to 7 of 7

Declaring and Initializing an Array of Strings

  1. #1
    Registered User
    Join Date
    12-02-2013
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    24

    Declaring and Initializing an Array of Strings

    When I run the below code, it throws a complication Error: Invalid Outside Procedure

    Please Login or Register  to view this content.
    Where am I wrong?

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

    Re: Declaring and Initializing an Array of Strings

    I do not see any error with the code.

  3. #3
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,088

    Re: Declaring and Initializing an Array of Strings

    This small piece of code looks good: See attached
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    12-02-2013
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: Declaring and Initializing an Array of Strings

    Thank you for the quick help friends.

    But I am still wondering. Also, while I run the code. along with the error message, the "ASSIGNED" value is highlighted to BLUE.

    Are there any alternative I can try?

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Declaring and Initializing an Array of Strings

    Please Login or Register  to view this content.
    You can declare variable as a module level global variable if you need to, however

    Please Login or Register  to view this content.
    This line should be within a procedure.

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

    Re: Declaring and Initializing an Array of Strings

    I have tested your lines and did not got any error. As long as you have sub and end sub, the code should work.
    There are not syntax errors on the two lines.

  7. #7
    Registered User
    Join Date
    12-02-2013
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: Declaring and Initializing an Array of Strings

    Exactly...that made all the difference. I guess, I have a lots to do with my basics

    Thanks a lot jindon.

    Thank you AB33 & PCI to look into my thread.
    Appreciate

+ 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. Help searching an array of text strings for common strings
    By ABComp in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-23-2012, 11:19 PM
  2. Replies: 9
    Last Post: 12-21-2012, 04:18 AM
  3. Problem declaring an array
    By LydiasDad in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 07-03-2011, 06:30 PM
  4. Declaring array through Inputbox
    By mother earth in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-13-2007, 06:18 AM
  5. Declaring a 2D array...
    By a303 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-24-2007, 11: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