+ Reply to Thread
Results 1 to 4 of 4

Type mismatch error with arrays

  1. #1
    Registered User
    Join Date
    01-06-2014
    Location
    Detroit, Mi
    MS-Off Ver
    Excel 2010
    Posts
    2

    Type mismatch error with arrays

    Hi All,

    New to the forums and VBA, and I've got a question about data type mismatches.

    Trying to essentially copy and paste values from 6 arrays to 6 different areas. I was trying to use this as an opportunity to try arrays out, but I'm stuck. Any help would be appreciated, and if reasoning could be used I would love to learn more about why this isn't working.

    Thank you!

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Type mismatch error with arrays

    You can't refer to variables using something like this.
    Please Login or Register  to view this content.
    All that ArrRName will contain is the string 'ArrX', where X is whatever value the loop variable I (or II) is.

    Same problem with DestName.

    This will work but I'm not sure if it'll help your understanding of arrays.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Type mismatch error with arrays

    I'd expect first problems here:
    Please Login or Register  to view this content.
    and more as you go down the code.

    ArrName is just a string. (Its value is "Arr1", but it can be anything, it is just a string), while Ubound needs array variable not just a string with this array variable name.
    Last edited by Kaper; 01-08-2014 at 12:28 PM.

  4. #4
    Registered User
    Join Date
    01-06-2014
    Location
    Detroit, Mi
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Type mismatch error with arrays

    Even the formatting helps me at this stage. I'll google some of the methodology used to get a better understanding (as the saying goestrying to learn to fish, not asking for fish). Thank you for the reply!

+ 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] Type Mismatch when assigning data from ranges (columns) to arrays
    By seigna in forum Excel Programming / VBA / Macros
    Replies: 32
    Last Post: 05-07-2013, 07:40 AM
  2. [SOLVED] Type Mismatch when trying to multiply arrays within function
    By weekendwarrior in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-24-2012, 03:10 PM
  3. Complile Error: Type Mismatch ??? After adding error trap
    By clemsoncooz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-22-2012, 03:50 PM
  4. [SOLVED] Help: Compile error: type mismatch: array or user defined type expected
    By lvcha.gouqizi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-31-2005, 05:05 PM
  5. [SOLVED] Help - Type mismatch when running loop with strings from arrays
    By Marie J-son in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-19-2005, 05:06 PM

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