Results 1 to 8 of 8

Noob: Case select & Statement

Threaded View

  1. #1
    Registered User
    Join Date
    03-24-2014
    Location
    Kingman, az
    MS-Off Ver
    Excel 2013
    Posts
    49

    Noob: Case select & Statement

    I have a case select that I use in another spreadsheet. I am trying to edit it to work for my current one. What I need to do is add an & statement. Meaning if C2 Case Is < 46.1 & D2 Case Is < 6 arrStore(StoreIndex) = "A"

    Currently this is what I have

    Sub SortIntoGroups()
        Dim varZip As Variant
        Dim arrStore() As String
        Dim StoreIndex As Long
    
        With Range("C2", Cells(Rows.Count, "C").End(xlUp))
            If .Row < 2 Then Exit Sub   'No data
            ReDim arrStore(1 To .Rows.Count)
            For Each varZip In .Value
                StoreIndex = StoreIndex + 1
                Select Case varZip
                    Case Is < 46.1
                        arrStore(StoreIndex) = "A"
                    Case 46 To 100
                        arrStore(StoreIndex) = "B"
                    Case Is > 100.1
                        arrStore(StoreIndex) = "C"
                    Case ""
                        arrStore(StoreIndex) = ""
                    Case Else
                        arrStore(StoreIndex) = "none"
                End Select
            Next varZip
        End With
    
        If StoreIndex > 0 Then Range("F2").Resize(StoreIndex).Value = Application.Transpose(arrStore)
    
    
    End Sub
    Last edited by dohara; 04-28-2014 at 10:07 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Utilize a Select Case Statement in Target Intersect Statement
    By max57 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2009, 08:55 PM
  2. Select Case Statement
    By Gos-C in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-13-2008, 09:34 AM
  3. Select Case Statement
    By Gos-C in forum Excel Programming / VBA / Macros
    Replies: 31
    Last Post: 06-18-2008, 09:00 AM
  4. Select Case Statement Help
    By Jeugo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-27-2006, 03:45 PM
  5. select case statement
    By jrd269 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-03-2005, 12:05 PM

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