+ Reply to Thread
Results 1 to 12 of 12

Code error in Array

  1. #1
    Forum Contributor
    Join Date
    02-26-2015
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    248

    Code error in Array

    I am running a macro that clears an array of specific text. I don't know enough to figure out why I can't run it successfully. The array includes approx. 120 names. I am wondering if it is too long? The text in red is where it hangs up.

    Please Login or Register  to view this content.
    Last edited by BDD2015; 01-19-2017 at 01:52 PM. Reason: clarity

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475

    Re: Code error in Array

    [/close] is the correct way to close the wrap

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475

    Re: Code error in Array

    What is the error you are getting?

    Please Login or Register  to view this content.
    errors for me,

  4. #4
    Forum Contributor
    Join Date
    02-26-2015
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    248

    Re: Code error in Array

    Wrap" as in the code I provided davesexcel? If so - but, but, lol - but last week I was told "Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code between
    Please Login or Register  to view this content.
    ..."

  5. #5
    Forum Contributor
    Join Date
    02-26-2015
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    248

    Re: Code error in Array

    It stops and highlights the -
    If StrComp(Range("e" & i), dontClear(j), vbTextCompare) = 0 Then

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475

    Re: Code error in Array

    Quote Originally Posted by BDD2015 View Post
    Wrap" as in the code I provided davesexcel? If so - but, but, lol - but last week I was told "Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code between
    Please Login or Register  to view this content.
    ..."
    Ya, I'm just saying it should be "/" not "\"

  7. #7
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475

    Re: Code error in Array

    Quote Originally Posted by BDD2015 View Post
    It stops and highlights the -
    If StrComp(Range("e" & i), dontClear(j), vbTextCompare) = 0 Then
    Yes, but what is the error you are getting?

  8. #8
    Forum Contributor
    Join Date
    02-26-2015
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    248

    Re: Code error in Array

    Sorry. Guess I am not using the correct words. I don't get an error per se. It just stops at now one of two lines, and highlights it in yellow.
    At either -
    Please Login or Register  to view this content.

  9. #9
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475

    Re: Code error in Array

    Usually a msgbox pops up, telling you what the error is.
    There are things in your code that can't be recognized,
    what is:?
    LBound(Delete) To UBound(Delete)
    dontClear(j)

    You can also edit your original post and change [\code] to [/code] , that way your code will be wrapped
    Last edited by davesexcel; 01-19-2017 at 11:46 AM.

  10. #10
    Forum Contributor
    Join Date
    02-26-2015
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    248

    Re: Code error in Array

    No, no message. Here is the workbook if you'd like to have a look.
    Attached Files Attached Files

  11. #11
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475

    Re: Code error in Array

    There's no way this code will work as it is, you are referencing functions that do not exist

  12. #12
    Forum Contributor
    Join Date
    02-26-2015
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    248

    Re: Code error in Array

    Can you explain or help fix the code? It does work when I use two names but again this list is massive. And I really, really do not understand VBA much at all. I've just been here for a week trying to get this job done, finding and modifying macros from online. Again, weird because it does work with two names.

+ 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. Replies: 2
    Last Post: 05-21-2015, 06:20 AM
  2. [SOLVED] Summing Array Variable by Another Value in the Array (VBA Code)
    By lloydgodin in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 09-18-2013, 10:13 AM
  3. [SOLVED] What is wrong with this code? (Extract Row from 2D array to 1D array)
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-10-2013, 07:17 AM
  4. [SOLVED] Array Formula vs vBa code - How To Modify My Messy Code To One Of Those
    By ScotyB in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-20-2012, 12:04 AM
  5. Defining Array - Runtime error 9, Subscript out of range error
    By MaartenW in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-03-2012, 07:32 AM
  6. Array problem: Key words-Variant Array, single-element, type mismatch error
    By davidm in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-09-2005, 01:54 AM
  7. Array problem: Key words-Variant Array, single-element, type mismatch error
    By davidm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-08-2005, 12:30 AM

Tags for this Thread

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