Results 1 to 4 of 4

Array not storing values that I've assigned to it.

Threaded View

  1. #1
    Registered User
    Join Date
    04-03-2014
    Location
    Woodbury, GA
    MS-Off Ver
    Excel 2010 and Excel 2013
    Posts
    37

    Question Array not storing values that I've assigned to it.

    Hello,

    I've found it useful, sometimes, to temporarily store data in an array for comparing and filtering data when moving between different sheets. I've never had any trouble with the code as it's pretty simple. But this morning I began a routine code using an array, but, for some reason, the array is not wanting to store the values that I'm trying to assign it. Perhaps someone can see where the bug is.

    Here's the Code for the array definition...

    'Get PCB Names into array for checking against main sheets values.
    Dim PCBNames(1 To 9) As String
    ThisWorkbook.Sheets("PCB Numbers").Select
    RowCount = ThisWorkbook.Sheets("PCB Numbers").Range("A5000").End(xlUp).Row
    For i = 1 To RowCount
        PCBNames(i) = Range("B" & i).Value
    Next i
    MsgBox PCBNames(1) & " " & PCBNames(2) & " " & PCBNames(3) & " " & PCBNames(4) 'This produces a blank message box even though there're values in the array when I step into the debugger.
    Any help provided would be much appreciated.
    Last edited by EverGreen1231; 01-08-2016 at 11:17 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Section of an Array Assigned to Another Array
    By HTMLGhozt in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-20-2015, 09:55 AM
  2. [SOLVED] Storing different data value in an array
    By exlgh91 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-21-2013, 12:10 PM
  3. [SOLVED] Storing Range Values into Array
    By thewizz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-07-2012, 01:18 PM
  4. Help in storing values to an array
    By crisshinn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-18-2011, 04:53 PM
  5. Getting Data From User And Storing Into Array
    By Dan_Dollar in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-13-2007, 06:25 PM
  6. Storing items in an array
    By iterature in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-08-2006, 07:05 PM
  7. Storing a vba lookup in an array
    By erikhs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-01-2006, 11:55 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