+ Reply to Thread
Results 1 to 5 of 5

Type Mismatch Errors Using Arrays

  1. #1
    Forum Contributor
    Join Date
    10-29-2019
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    156

    Type Mismatch Errors Using Arrays

    Hi, I'm trying to copy a range to an array, but I keep getting type mismatch errors extracting values from the array to a string.

    I get errors on line 18 MsgBox Arr

    & line 27 strCityOnly = Left(Arr, InStr(Arr, " ") - 1)



    I've enclosed the spreadsheet,

    Thanks.,

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Type Mismatch Errors Using Arrays

    Arr is the entire array. You have to process each element in turn using Arr(R, 1) in your loop rather than just Arr.
    Rory

  3. #3
    Forum Contributor
    Join Date
    10-29-2019
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    156

    Re: Type Mismatch Errors Using Arrays

    Thanks!!!!!!!!!!!!!!!!!!!!!!!!!

  4. #4
    Forum Contributor
    Join Date
    10-29-2019
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    156

    Re: Type Mismatch Errors Using Arrays

    Hey, i'm having problems transposing values from the array. Atm it just copies the first cell several times instead of the entire range ...

    Spreadsheet enclosed just in case ..

    Thanks

    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Type Mismatch Errors Using Arrays

    If you want to transpose it, your output range should be multiple columns, not multiple rows:

    Please Login or Register  to view this content.

+ 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. Type Mismatch Errors Working WIth Date/Time
    By Jenn68 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-25-2020, 11:07 AM
  2. [SOLVED] Type mismatch error with arrays
    By heph84 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-08-2014, 12:26 PM
  3. [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
  4. Type Mismatch Errors...:Val() function
    By yellephant in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-27-2007, 04:01 PM
  5. Type Mismatch Errors...
    By yellephant in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-19-2007, 09:39 AM
  6. Type Mismatch Errors...
    By yellephant in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-01-2007, 09:32 AM
  7. [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