+ Reply to Thread
Results 1 to 8 of 8

Select Case debug

  1. #1
    Registered User
    Join Date
    07-15-2016
    Location
    Lowell, Massachusetts
    MS-Off Ver
    2010
    Posts
    31

    Select Case debug

    Basically what i want to happen is in column I there is several product types that i want to replace with a range of values from a separate tab, can't figure out why its not working, keep getting "type match error #13" on the first Case Is line.

    For j = 4 To 20000
    Select Case Range("I4:I20000").Value
    Case Is = "GEM 4000"
    Result = Sheets("INPUT").Select
    Range("B6:J6").Copy
    Sheets("IL Inventory").Select
    Cells("j", 9).Paste
    Case Is = "GEM 5000"
    Result = Sheets("INPUT").Slect
    Range("B8:J8").Copy
    Sheets("IL Inventory").Select
    Cells("j", 9).Paste
    End Select
    Next j

    Please Help
    Thanks in advance

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Select Case debug

    Please take a few minutes to read the Forum Rules, and then edit your post to wrap your code with CODE tags.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    07-15-2016
    Location
    Lowell, Massachusetts
    MS-Off Ver
    2010
    Posts
    31

    Re: Select Case debug

    Please Login or Register  to view this content.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Select Case debug

    Thank you.

    You can't compare a scalar value to an array; you need to test one value at a time. I can't tell what the rest of the code is supposed to do. Maybe this:

    Please Login or Register  to view this content.
    Last edited by shg; 08-05-2016 at 12:40 PM.

  5. #5
    Registered User
    Join Date
    07-15-2016
    Location
    Lowell, Massachusetts
    MS-Off Ver
    2010
    Posts
    31

    Re: Select Case debug

    That worked thanks, but now im getting the same error in the line where I specify the paste location

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Select Case debug

    Sorry, I've made several edits. Try the code in the current post.

  7. #7
    Registered User
    Join Date
    07-15-2016
    Location
    Lowell, Massachusetts
    MS-Off Ver
    2010
    Posts
    31

    Re: Select Case debug

    Yep that worked, thanks for the help

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Select Case debug

    You're welcome.

+ 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] Need the proper syntax to use Case/Select Case in vba properly.
    By rbion in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-16-2013, 02:34 PM
  2. [SOLVED] Disregard case in VBA code. (UCase, LCase, Select Case)
    By Orestees in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 09-07-2012, 12:12 PM
  3. Case Select compile error "Case without case select"
    By coasterman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-23-2012, 06:50 AM
  4. select case macro error debug
    By arnab0711 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-30-2011, 07:31 PM
  5. Select Case stops after 1st case
    By skysurfer in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-02-2010, 04:25 PM
  6. Case Select....The alternative method for long "Select Case"
    By kimyap in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2008, 01:24 AM
  7. Case without select case error
    By Tano in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-25-2007, 10:27 AM
  8. Select case / case is, multiple arguments
    By Werner Rohrmoser in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-03-2006, 07:00 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